Skip to content
shadcn.io

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.

Framework
UI library

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

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 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.

When is size-8 the right class?

This demo is the wheel on its own, which suits a page or a panel that is still loading. Beside body text, size-4 matches the other icons. In a dense line, size-3 does.

How do I center this spinner in a panel?

The spinner has no position of its own. Put it in a flex box with items-center and justify-center, and give that box the panel's height, such as min-h-48.