Spinner
A small indicator for a wait you can't measure. It is a drop-in for shadcn's Spinner: it announces "Loading" to screen readers, takes its size from className and its color from the text around it.
Install
npx shadcn@latest add @nelumbo/spinnerVariants
The ring is an arc that turns while it grows and shrinks, like Material's indeterminate circular indicator. "shapes" is the LoadingIndicator, a soft form that morphs as it turns; it reads best from about 32px up.
ring
shapes
Sizes and color
Size with a size-* class. The color is the current text color, so text-brand or text-muted-foreground just work.
In buttons
Place it first in the label. Button's own loading prop uses the same kind of arc and also blocks interaction.
In badges and inputs
In a badge it takes the badge's text color; in an input, use the trailing slot.
Checking if it is free.
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
variant | "ring" | "shapes" | "ring" | Arc, or the morphing LoadingIndicator. |
className | string | Size with size-*; defaults to the icon size around it (1.25em). | |
aria-label | string | "Loading" | Name announced by screen readers. The element has role=status. |