Short action
Indicate that a save or refresh is working inside its button.
Components / Display
A compact, reduced-motion-aware loading indicator.
Publishing release
Step 3 of 4npx @getweini/cli@latest add spinnerIndicate that a save or refresh is working inside its button.
Pair motion with text while one dashboard section refreshes.
<button type="button" aria-busy="true" class="inline-flex items-center gap-2">
<Spinner />
Saving
</button>Keep the visible action text and busy state together.
<script setup lang="ts">
import Button from './components/ui/button/Button.vue'
import Spinner from './components/ui/spinner/Spinner.vue'
</script>
<template>
<Button disabled aria-busy="true"><Spinner size="sm" /> Saving changes…</Button>
</template>A labelled spinner can stand alone when the text cannot fit beside it.
<script setup lang="ts">
import Spinner from './components/ui/spinner/Spinner.vue'
</script>
<template>
<section aria-busy="true" aria-label="Refreshing results">
<Spinner label="Loading results" />
</section>
</template>The most useful props, models, slots, events, and methods for this component.
| Name | Type | Default or requirement |
|---|---|---|
size | sm | md | lg | md |
label | string | undefined |
Spinner is decorative without label. Prefer visible status text and aria-busy on the surrounding region.