shadcn.io is not affiliated with official shadcn/ui
Spinner examples · Standard
Large Spinner for React
A large 32px spinner for a page or a panel that is loading.
A 16px wheel gets lost in an empty page. This Spinner takes size-8, 32px, for a page, a panel or an overlay where the wait is the only thing on screen.
Preview
Installation
FAQ
How does this spinner become 32px?
Spinner defaults to size-4 (16px). This file passes size-8, which sets the width and height to 32px. Size is that class. There is no size prop.
What color is the large spinner?
The icon uses currentColor, so it takes the text color around it. This file adds no color class, so it matches the parent. Add text-primary or text-muted-foreground on the same Spinner to change it.
What does a screen reader announce for this spinner?
It renders with role="status" and an aria-label of Loading. Pass your own aria-label, such as "Loading the page", when the wheel is the only thing in view.
How do I stop the large spinner for reduced motion?
The spin is the animate-spin class. Add motion-reduce:animate-none and the icon stays still. The status role and the label stay.
Related
- Default SpinnerA spinner at its default size and color
- Small SpinnerA small 12px spinner for dense and inline
- Spinner in Input GroupA disabled input and textarea with a
- Inline with Text SpinnerA spinner beside a Loading data
- Muted SpinnerA spinner in the muted foreground color
- Primary Color SpinnerA spinner in the primary color for a