Skip to content
shadcn.io

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.

Framework
UI library

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

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

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.

What does a screen reader announce?

The spinner has role="status" and an aria-label of Loading, at any size. Pass your own aria-label, such as "Saving", when Loading is too vague. A visible word next to the icon says the same thing in text.

How do I stop the small spinner for reduced motion?

The spin is animate-spin. Add motion-reduce:animate-none and the 12px icon stays still. The status role and the label stay.