Spinner
An animated loading indicator with role="status" and a visually-hidden accessible label.
Preview
LoadingLoadingLoading
Usage
import { Spinner } from "anexui";
<Spinner />
Copy codeSizes
<Spinner size="sm" />
<Spinner size="md" />
<Spinner size="lg" />
Copy codeCustom label
<Spinner label="Loading dashboard…" />
Copy codeInside a button
<Button disabled>
<Spinner size="sm" label="" />
Saving…
</Button>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| size | "sm" \| "md" \| "lg" | "md" | Size of the spinner SVG |
| label | string | "Loading…" | Accessible label announced by screen readers (visually hidden) |
Accessibility
role="status"witharia-live="polite"announces the label on mount- Label text is visually hidden using a
.sr-onlyutility — visible only to screen readers - Pass
label=""when the surrounding context already announces loading (e.g., inside a loading button)