Skip to content

React Loading Spinner

A React loading spinner for work with no known length, announced politely and held still as a static arc under reduced motion. Use Spinner as a loading indicator in React for a wait with no known length, such as a route transition, a panel waiting for data or a search that has just been submitted.

npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/spinner.json
Syncing files

Syncing 24 files

This takes as long as it takes.

Sizes, tones and loading buttons

Five sizes on glass with their names, a labelled panel, muted and current-colour tones, and a row of busy buttons. showLabel prints the text; the label is always read aloud.

Loading
xs
Loading
sm
Loading
md
Loading
lg
Loading
xl
Loading your projects

The label is read aloud as "Loading your projects" and shown under the ring.

LoadingMuted, for quiet panels
LoadingCurrent colour, on a filled surface

Files to copy

3 folders · 1 file · 4 packages
From theme/src/
  • components/spinner/
  • lib/cn.ts
  • styles/
shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/spinner.jsonRegistry item: spinner. The styles need the Tailwind v4 glass UI setup.
The examples also use
  • components/button/
  • hooks/{use-latest.ts, use-magnetic.ts, use-media-query.ts, use-preferences.ts}
  • motion/{gate.ts, tokens.ts}
  • lib/{form.ts, state-light.tsx}
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/button.json
Packages
pnpm add @base-ui/react clsx motion tailwind-merge

Props

PropTypeDefaultDescription
size"sm" | "md" | "lg" | "xl" | "xs""md""xs" (12px), "sm" (16px), "md" (24px), "lg" (32px) or "xl" (48px).
tone"accent" | "current" | "muted""accent""current" follows the surrounding text colour, "accent" or "muted".
showLabelbooleanfalsePrint the label next to the spinner instead of hiding it from sight.
labelsPartial<SpinnerLabels>defaultSpinnerLabelsEvery other string, for translation: labels={{ loading: "…" }}; omitted keys keep the English of defaultSpinnerLabels. Its only key is listed in the key table under the props table.
SpinnerLabels keys and English defaults (1)
Pass any key in labels; the rest keep the defaults of defaultSpinnerLabels.
KeyEnglish default
loadingLoading

All exports on this page

  • Spinner — A loading spinner for something that has no known length (a button, a panel, a route).
  • defaultSpinnerLabels — The English SpinnerLabels used when labels is omitted; a partial labels prop is merged over it.

Keyboard

KeysAction
TabNot focusable: a spinner is a read-out. Put it inside a control that is busy, not on a tab stop of its own.

Accessibility

  • It is a role="status" live region with a visually hidden label ("Loading" by default), so mounting it announces politely. Remove it when the work is done.
  • The ring itself is aria-hidden. Use labels.loading to say what is loading, in the page language.
  • Reduced motion (OS setting or the in-app toggle) keeps the arc turning, slower: it is the loading signal itself. Everything else about the page stops moving.
  • The track keeps 3:1 against the surface; forced colors draw it in CanvasText.

When to use Spinner

  • Use Spinner next to a Saving label or inside a disabled button while a request runs and you cannot say how long it will take; switch to Progress once you can report how far along it is.
  • Use showLabel to print the word Loading next to the ring in an empty state, and keep the default hidden label for places where the ring alone is clear.
  • Use tone current to inherit the surrounding text color inside a button or a badge, and the xs or sm sizes to fit a line of text.
  • Skip it when the task has a measurable end, where Progress fits, or when you know the shape of the incoming content, where Skeleton gives a calmer placeholder.
  • Pair it with Button, which shows its own spinner through the loading prop, useOffscreenLoops near the app root to pause off-screen loops, and EmptyState for a loading panel.

Frequently asked questions

67 components pages in all: browse them on All components.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .