Spinner
Indicate that an operation is still in progress.
Installation
pnpm dlx shadcn@4.18.0 add @siteplane/spinnerComplete the one-time setup first. Registry JSON lists source files and dependencies.
For this page’s examples, also install:
pnpm dlx shadcn@4.18.0 add @siteplane/input-groupUsage
import { Spinner } from "@/siteplane/components/spinner";
<Spinner />;Variants
Select an indeterminate visual treatment; none of these variants reports numeric progress.
Sizes
Without a size class, the default, comet, ring, pulse and spokes variants are 16 px. Scale a spinner with size utilities: those variants follow the root size, dots keep their mark size and bars scale only in height.
Labels
Name what is loading. When visible text already describes the operation, hide the spinner from assistive technology. For a pending button, use the Button loading prop or LoadingButton instead of placing a spinner in the button.
Input group
Show a spinner in an input group addon while a search or validation runs.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
variant | SpinnerVariant | default | default, ring, dots, bars, spokes, pulse or comet. |
class | string | unset | Additional classes; size utilities customize SVG, ring, pulse and spokes dimensions. |
aria-label | string | Loading | Accessible loading label. |
role | ARIA role | status | Status semantics unless overridden. |
SpinnerProps and SpinnerVariant are exported. The props and the ref follow the element that the variant renders, an SVG for default and comet and a div for the others. Dots size their marks directly, and bars keep a fixed bar width while their height follows the root.
Usage notes
Use Progress for measurable completion. A spinner does not start, cancel or finish a request. Your application owns pending/error state and when to remove it.