Spinner
An indeterminate loading spinner.
Spinner is a circular indicator for indeterminate loading (the percentage is unknown). For a known percentage, use Progress. For a layout placeholder, use Skeleton.
Installation
$ bext ui add spinner
Copy and paste the following into src/components/ui/spinner.tsx.
Usage
Anatomy
<Spinner size="h-4 w-4" />
API Reference
Spinner
| Prop | Type | Default | Description |
|---|---|---|---|
| size | string | "h-4 w-4" | Height and width utility classes, for example "h-6 w-6". There are no named sizes. |
| className | string | — | Extra classes appended to the <svg>, for example a text color. |
Accessibility
Spinner sets role="status" and aria-label="Loading" on its <svg>, so it is announced without extra markup. The label is fixed: when the spinner sits next to visible text that already says what is loading, wrap it in an element with aria-hidden="true" to avoid a double announcement.
On This Page