Spinner
Indeterminate loading spinner, sized to match an Icon. Decorative (aria-hidden) by default; with label it is a progressbar named by the label.
Use for
- an indeterminate loading indicator
- a spinner standing in for an icon
Practices
| Guidance | Practice |
|---|---|
| Do | Pass a localized label when the spinner is the only sign of progress. |
| Don’t | Render a spinner inside a button by hand. Use SubmitButton instead. |
| Don’t | Show it as soon as work starts. Gate it with useSpinDelay so it does not flash. |
API reference
Spinner
Renders a span and forwards its ref. Carries data-size.
Slot: cl-spinner
| Prop | Type | Description |
|---|---|---|
size | 'sm' | 'md' | sm or md, matching the Icon sizes.Default: 'md' |
label | string | Accessible name. Makes the spinner a progressbar instead of decorative. |
Examples
Decorative
<Spinner />Announced
<Spinner size='sm' label={t('loading')} />Related
SubmitButton- useSpinDelay
- Skeleton