shadcn.io is not affiliated with official shadcn/ui
The plain Spinner, with no classes added: a 16px loader icon that spins and takes the text color around it. Start here for any short wait, and add a size or color class only when the context asks for one.
Preview
Installation
FAQ
When should I use default spinner versus customized variants?
Use the default for most loading states, so every wait in the app looks the same. Change the size when the spinner sits in dense text (size-3) or alone in an empty area (size-8), and the color when it should step back (text-muted-foreground) or carry the brand (text-primary).
What is the default spinner size and how does it compare to other sizes?
It is size-4, 16px, the same as the other icons in buttons and body text. size-3 (12px) fits small inline status, size-6 (24px) a card, and size-8 (32px) a page or panel. There is no size prop: pass the class.
What color is the default spinner and can I change it?
It draws with currentColor, so it takes the text color of its parent. Set a text class on it or on the parent, such as text-muted-foreground, text-primary or text-destructive.
How do I center a standalone spinner on the page?
Put it in a flex container with items-center and justify-center, sized to the area it covers: min-h-48 for a panel, or fixed inset-0 for a full-screen overlay. The spinner itself has no position.
Related
- Small SpinnerA small 12px spinner for dense and inline
- Large SpinnerA large 32px spinner for a page or a
- Primary Color SpinnerA spinner in the primary color for a
- Inline with Text SpinnerA spinner beside a Loading data
- Loading Button SpinnerA disabled button with a spinner before
- Spinner in ItemA download row with a spinner, the size