shadcn.io is not affiliated with official shadcn/ui
Spinner examples · Standard
Small Spinner for React
A small 12px spinner for dense and inline loading states.
A full-size wheel can be too heavy beside small text. This Spinner takes size-3, 12px, for auto-save notes, toolbar status and other quiet waits.
Preview
Installation
FAQ
How does this spinner become 12px?
Spinner defaults to size-4 (16px). This file passes size-3, which sets the width and height to 12px. Size is that class.
What color is the small spinner?
The stroke is currentColor, so it takes the text color around it. This file sets only the size. Add text-muted-foreground or text-primary on the same Spinner when the color should change too.
What text size sits next to a size-3 spinner?
text-sm or text-xs lines up with a 12px icon. Put both in a flex row with items-center and gap-2, and keep the spinner at size-3.
Can I put this spinner in a small button?
Yes. On a Button with size="sm", pass size-3 on the Spinner and set data-icon to inline-start so the button's icon spacing applies. Disable the button so it can't be pressed again.
Related
- Default SpinnerA spinner at its default size and color
- Large SpinnerA large 32px spinner for a page or a
- Spinner Before TextA small spinner before a muted line of
- Spinner After TextA small spinner after a line of text
- Loading Button SpinnerA disabled button with a spinner before
- Muted SpinnerA spinner in the muted foreground color