Spinner Component
Spinner shows a lightweight loading indicator for pending operations. It supports multiple styles (Circular, Cupertino, SingleCircle, DoubleCircle), configurable size and thickness, theme colors, and a fullscreen overlay mode. Example
Usage
To import and use the Spinner component in your application, use the following code snippet:
Demos
Explore the demos of the React Spinner component. Refer to this page.
Props
The following table outlines the props for the Spinner component:
| Name | Type | Default | Description |
|---|---|---|---|
| animationDuration | string | '1s' | Specifies the animation duration for spinner effects such as rotation, fade, or pulse. Accepts values like '1s' or '800ms'. |
| color | Color.Primary | Specifies the Color style of the spinner. Options include 'Primary', 'Secondary', 'Warning', 'Success', 'Error', and 'Info'. | |
| label | string | - | Specifies optional text displayed next to the spinner. Recommended for accessibility when the surrounding UI lacks context. |
| overlay | boolean | false | Specifies whether the spinner should render as a fullscreen fixed overlay with a dimmed backdrop. |
| size | string | number | 36px | Specifies the spinner size.
|
| thickness | string | '3px' | Specifies the stroke thickness for circular variants. Accepts any valid CSS length (e.g., '3px'). |
| type | SpinnerType.Circular | Specifies the visual style of the spinner. Available options (SpinnerType):
| |
| visible | boolean | true | Specifies whether the spinner is visible. When set to false, renders null. |