Sizes
import { Spinner } from "@senvenli/react/feedback";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-300">
<Spinner size="small" aria-label="Saving draft" />
<Spinner aria-label="Checking the address" />
<Spinner size="large" aria-label="Loading orders" />
</Stack>
);
}import { Spinner } from "@senvenli/react/feedback";Examples
Beside visible text
The text already says it, so the spinner is decorative.Checking the invoice number…
import { Text } from "@senvenli/react/display";
import { Spinner } from "@senvenli/react/feedback";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-100">
<Spinner size="small" isDecorative />
<Text size="body-small" tone="subtle">Checking the invoice number…</Text>
</Stack>
);
}Guidelines
When to use it
- Something short is loading in place.
Use something else when
- A whole layout is loading. Skeleton
Accessibility
Built in
- Named "Loading…" unless decorative or labelled.
You provide
isDecorativewhen visible text already says what is loading.
API reference
Spinner
| Prop | Type | Default | Description |
|---|---|---|---|
size | SpinnerSize | "medium" | |
aria-label | string | – | What is happening ("Checking availability"). Omit when visible text next to it says it, and pass |
isDecorative | boolean | – | Visible text already says it (a pending button): hidden from assistive tech. |
sizeSpinnerSizeDefault"medium"aria-labelstringWhat is happening ("Checking availability"). Omit when visible text next to it says it, and pass
isDecorative; otherwise "Loading…".isDecorativebooleanVisible text already says it (a pending button): hidden from assistive tech.