Feedback e status
VSpinner
Indicador de carregamento flexível para comunicar progresso e estados de espera: confirma processamento em botões ("Creating project…"), sobreposições ("Loading your project… This may take a few seconds.") e conteúdo inline (listas, tabelas, secções). Pro tip: emparelhar sempre o spinner com um rótulo descritivo (prop `label` ou texto visualmente escondido) para melhor acessibilidade.
<script setup lang="ts">
import { VSpinner } from 'vueui-nova-kit'
</script>Uso
<script setup lang="ts">
</script>
<template>
</template>Playground
Os controles abaixo são gerados a partir das props declaradas em VSpinner.types.ts; o código acompanha cada mudança.
Exemplos
Variantes, tamanhos e estados, extraídos das stories da biblioteca.
Default
Variação Padrão. Estado padrão do componente; use a aba Controls para experimentar as props ao vivo. Props: color="default".
Ver código
<script setup lang="ts">
import { VSpinner } from 'vueui-nova-kit'
</script>
<template>
<VSpinner color="default" />
</template>Primary
Variação Primária. Props: color="primary".
Ver código
<script setup lang="ts">
import { VSpinner } from 'vueui-nova-kit'
</script>
<template>
<VSpinner />
</template>Dots
Variação Dots. Props: variant="dots".
Ver código
<script setup lang="ts">
import { VSpinner } from 'vueui-nova-kit'
</script>
<template>
<VSpinner variant="dots" />
</template>Ring
Variação Ring. Props: variant="ring".
Ver código
<script setup lang="ts">
import { VSpinner } from 'vueui-nova-kit'
</script>
<template>
<VSpinner variant="ring" />
</template>Inline
Variação Inline. Props: variant="inline", size="sm", label="Loading data…".
Ver código
<script setup lang="ts">
import { VSpinner } from 'vueui-nova-kit'
</script>
<template>
<VSpinner size="sm" variant="inline" label="Loading data…" />
</template>Decorative
Variação Decorativo. Props: decorative=true. Usar quando o contexto já anuncia o carregamento (texto visível ou aria-busy): o spinner vira aria-hidden="true" sem role.
Ver código
<script setup lang="ts">
import { VSpinner } from 'vueui-nova-kit'
</script>
<template>
<VSpinner decorative />
</template>Empty Label
Variação Label vazio. Props: label="". O spinner continua anunciado via role="status" com o texto acessível padrão ("Loading") em texto visualmente oculto.
Ver código
<script setup lang="ts">
import { VSpinner } from 'vueui-nova-kit'
</script>
<template>
<VSpinner />
</template>Paused
Variação Paused. Props: paused=true.
Ver código
<script setup lang="ts">
import { VSpinner } from 'vueui-nova-kit'
</script>
<template>
<VSpinner paused />
</template>Disabled
Variação Desabilitado. Props: disabled=true.
Ver código
<script setup lang="ts">
import { VSpinner } from 'vueui-nova-kit'
</script>
<template>
<VSpinner disabled />
</template>Loading
Variação Carregando. Props: loading=true.
Ver código
<script setup lang="ts">
import { VSpinner } from 'vueui-nova-kit'
</script>
<template>
<VSpinner />
</template>Lattice Resolved Success
Variação Lattice Resolved sucesso. Props: variant="lattice", latticeSize=4, verb="Pensando", resolved="success".
Ver código
<script setup lang="ts">
import { VSpinner } from 'vueui-nova-kit'
</script>
<template>
<VSpinner
variant="lattice"
:lattice-size="4"
verb="Pensando"
resolved="success" />
</template>Lattice Resolved Error
Variação Lattice Resolved erro. Props: variant="lattice", latticeSize=3, verb="Falhou", resolved="error".
Ver código
<script setup lang="ts">
import { VSpinner } from 'vueui-nova-kit'
</script>
<template>
<VSpinner variant="lattice" verb="Falhou" resolved="error" />
</template>Acessibilidade
Semântica nativa primeiro, foco visível, labels acessíveis e teclado conforme o padrão WAI-ARIA correspondente.
Estados
Default · Hover · Focus-visible · Pressed/Active quando aplicável · Disabled · Loading quando aplicável.
Motion
| Trigger | Property | Duration | Easing |
|---|---|---|---|
| Hover | background/transform | 100ms | standard |
| Focus | outline/box-shadow | 100ms | standard |
| Enter/Exit | opacity/transform | 160ms | standard |
Respeitar prefers-reduced-motion.
Todas as transições respeitam prefers-reduced-motion e os tokens --v-duration-*.
Props
| Prop | Tipo | Default | Descrição |
|---|---|---|---|
variant | VSpinnerVariant | "circular" | Visual style of the indicator. |
color | VSpinnerColor | "primary" | Indicator color treatment. |
inheritColor | boolean | false | Uses `currentColor` so the spinner follows the surrounding text (buttons, items). |
size | VSpinnerSize | "md" | Diameter of the spinner. |
label | string | "Loading" | Visible loading text. Quando vazio (`""`), o texto acessível do fallback ("Loading") continua sendo anunciado via `role="status"`. |
decorative | boolean | false | `true` quando o contexto já anuncia o carregamento (ex.: texto visível ou `aria-busy` no container). Oculta o spinner da árvore de acessibilidade (`aria-hidden="true"`, sem `role`). Default `false`. |
ariaLabel | string | — | Optional override for the accessible name. |
disabled | boolean | false | Freezes animation and marks the control unavailable. |
loading | boolean | true | Exposes a busy state for async contexts. |
paused | boolean | false | Pauses animation while keeping the indicator visible. |
latticeSize | 3 | 4 | 3 | Lattice Loader: grid dimension (3 or 4). |
verb | string | — | Lattice Loader: status verb beside the grid. |
resolved | 'success' | 'error' | null | null | Lattice Loader: resolved state. |
Events
Não emite eventos.
Slots
| Slot | Props do slot |
|---|---|
#default | — |
Fonte: src/components/feedback/VSpinner/VSpinner.vue · tipos: src/components/feedback/VSpinner/VSpinner.types.ts