Spinner
The Spinner component displays a visual loading indicator while content or an action is in progress. It can be used to communicate that an operation is currently being processed or that content is loading.
Examples
Colors
Use the color prop to communicate the context or status of a loading
operation.
Sizes
Use the size prop to control the size of the Spinner.
Label
Use the label prop to provide accessible text that describes the
loading state.
The default label is Loading. Use a more specific label when the
loading operation has a clear purpose, such as Saving or
Loading results.
Custom Styling
Use the class prop to apply custom CSS classes to the Spinner.
Use custom classes when you need to adjust the Spinner’s appearance to match a specific layout or design.
Accessibility
- Provide a meaningful
labelthat describes what is currently loading when the defaultLoadinglabel is not specific enough. - Do not rely on the Spinner’s animation or color alone to communicate loading or status information.
- Ensure the Spinner has sufficient contrast against its background.
- Keep the loading label concise and descriptive.
- Use a Spinner alongside visible status text when users need additional context about a long-running operation.
API
Spinner
The Spinner component supports custom styling, semantic colors, sizes, and accessible loading labels.
| Pro | Type | Required | Default | Description |
|---|---|---|---|---|
| class | string |
No | — | Custom CSS class to apply to the Spinner. |
| color | "default" | "success" | "warning" | "info" | "error" |
No | "default" |
Controls the semantic color of the Spinner. |
| label | string |
No | "Loading" |
Accessible label describing the current loading state. |
| size | "small" | "medium" | "large" |
No | "medium" |
Controls the size of the Spinner. |