Spinner
A visual indicator of a loading or processing state.
Usage
The Spinner component provides a way to show a spinner.
Spinner Props
Prop | Type | Default |
---|---|---|
size | 1 | 2 | 3 | 4 | 5 | 6 | 1 |
color | "default" | "neutral" | "accent" | "danger" | "success" | "attention" | "default" |
className | string | - |
Examples
Size
The Spinner component offers different size options. You can customize the size of the spinner using the size
prop. The available size options are:
Color
The Spinner component offers 6 color values. default
prop sets the color to currentColor
mainly helpful if we want to render the Spinner inside another component like Button. Spinner (with color="default") inherits the foreground color of button text.
Accessibility
The Spinner component includes appropriate ARIA attributes for accessibility:
role="status"
: Indicates that the element is a status indicator.aria-hidden="true"
: Hides the spinner from screen readers, as it's a visual indicator only.