Spinner
stableA status indicator for pending work.
Basic usage
LoadingLoadingLoadingLoading large preview
Examples
Loading button
Embed a Spinner inside a Button to indicate an async action in progress.
Sizes and labels
Use different sizes and labels for button, inline and page-level loading states.
Loading small actionLoading contentLoading page sectionLoading full page
Semantic colors
Color prop applies semantic tints to the spinner for contextual loading states.
primary loadingsecondary loadingerror loadingwarning loadinginfo loadingsuccess loading
Features
- Announces loading state with role="status".
- Four token-driven sizes.
- Accepts a custom screen-reader label.
Installation
bash
pnpm dlx structyl add spinnerAPI Reference
Spinner
A loading status indicator.
| Prop | Type | Default |
|---|---|---|
| size | 'sm' | 'md' | 'lg' | 'xl'Visual size. | 'md' |
| label | stringVisually hidden label announced to assistive technology. | 'Loading' |
| className | stringAdditional Tailwind classes, merged with the component defaults. | — |