Spinner
A rotating loader icon, 16px by default. Set size in pixels to match the text next to it.
Installation
Copy the command below and run it in your terminal.
Usage
Spinner has no role or live region. Put text next to it that describes the work, and set aria-hidden so screen readers skip the icon. Set ready when the work finishes.
Speed and curved rotation
One turn takes 850ms; speed multiplies
the rate, so a speed of 2 takes 425ms. curved speeds up and slows down within each turn instead of spinning at a constant rate.
Completion state
Set ready to true when the work succeeds.
The spinner swaps to a checkmark, holds it for two seconds, then collapses and removes
itself. Set ready back to false to show
it again.
Anatomy
Spinner - Spins while loading and resolves to a checkmark.
<script lang="ts"> import { Spinner } from '@sivir-ui/svelte/components/spinner'; </script> <div class="flex items-center gap-3 text-sm text-foreground-muted"> <Spinner aria-hidden="true" /> <span>Checking for updates</span> </div>