Spinner
FeedbackA turning circle for a wait of unknown length. It is a status region named by label ("Loading" by default), so a screen reader announces it when it appears. It is 16px and takes the text colour; class sizes and colours it (size-6 text-muted). It stops turning with reduced motion.
import { Spinner } from '@limerdev/zest'; Use for
A short wait the user started: saving, a search, loading the next page. In a button, use the Button's
loading instead. Don't
A first load whose layout is known: use
Skeleton. Progress you can measure: use Progress. Several spinners on one screen: show one for the region that is loading.Examples
Basic
A wait of unknown length, named for screen readers by label.
Loading invoices…
<script lang="ts">
import { Spinner } from '@limerdev/zest';
</script>
<p class="flex items-center gap-2 text-sm text-muted">
<Spinner label="Loading invoices" /> Loading invoices…
</p> Sizes and colours
class sizes and colours it; it takes the text colour by default.
<script lang="ts">
import { Spinner } from '@limerdev/zest';
</script>
<div class="flex items-center gap-4">
<Spinner class="size-3" />
<Spinner />
<Spinner class="size-6 text-primary" />
<Spinner class="size-8 text-muted" />
</div> Props
Every part also takes class (merged over its defaults), ref (bindable: the element), children, and child (a snippet that
renders your own element, with props to spread on it).
Spinner
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | the Config's `strings.loading`, else 'Loading' | What is happening, for screen readers. |