Installation
- CLI
- Manual
Usage
Examples
Sizes
Spinner supports the standard size system.With Text
Combine spinner with loading text.Centered
Center the spinner in a container.Custom Stroke Width
Adjust the stroke width for different visual weights.Custom Color
Override the color with CSS classes.Button Loading State
Show spinner in buttons during loading.API Reference
Spinner
Size of the spinner.Options:
"xs" | "sm" | "md" | "lg" | "xl"Stroke width of the spinner icon.
Additional CSS classes.
Accessibility
- Has
role="status"for screen reader announcements - Includes
aria-label="Loading"for context - Always pair with text for critical loading states
- Use meaningful loading messages nearby
Best Practices
- Use for indeterminate loading states
- Prefer Progress for determinate operations
- Don’t use multiple spinners simultaneously
- Center spinners in their container
- Provide context about what’s loading
- Use appropriate sizes for the context (e.g.,
smfor buttons) - Consider skeleton loaders for content placeholders