Spinner
Shows a loading indicator for a task with no known end time.
spinner-basic-demo.tsx
Installation
The CLI adds the files, packages, theme variables, and Tailwind plugin that this component uses. Before you run it, set up your project.
npm
yarn
pnpm
bun
Variants
Each variant animates only transform and opacity, so it stays smooth when the page is busy. With reduced motion, it stops.
- Ring
- Segments
- Dots
spinner-demo.tsx
Sizes
xs · 14px
sm · 16px
md · 24px
lg · 40px
xl · 56px
spinner-sizes-demo.tsx
Color
The spinner uses the current text color.
spinner-color-demo.tsx
Loading overlay
Set aria-busy on the region while it loads, and keep the old content in place. Also install Button.
- Visitors
- 12,480
- Sign-ups
- 342
- Conversion
- 2.7%
spinner-overlay-demo.tsx
API reference
- variant: "ring" | "dots" | "segments" = "ring"
- Sets the animation style.
- size: "xs" | "sm" | "md" | "lg" | "xl" = "md"
- Sets the size: 14, 16, 24, 40, or 56 pixels.
- decorative: boolean = false
- Hides the spinner from screen readers. Use it when text next to the spinner names the wait.
- aria-label: string = "Loading"
- Names the wait for screen readers.