| title | Spinner |
|---|---|
| description | A visual indicator of a loading or processing state. |
| source | packages/raystack/components/spinner |
import { playground, sizeDemo, colorDemo } from "./demo.ts";
Import and assemble the component:
import { Spinner } from "@raystack/apsara";
<Spinner />Renders a loading spinner animation.
The Spinner component offers different size options. You can customize the size of the spinner using the size prop. The available size options are:
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.
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.- Respects motion preferences: spinner rotation is enabled only when
prefers-reduced-motion: no-preference