Skip to main content

Spinner

An accessible SVG loading indicator with four styles that follow the page tempo and slow down under reduced motion.

variant="ring"·speed:1x

Customize

Speed1

Installation

npx shadcn@latest add @kinetic/spinner

Usage

Render Spinner where content is loading. It announces itself with role="status".

import { Spinner } from "@/components/kinetic/ui/spinner";

export function Loading() {
  return <Spinner label="Loading results" />;
}

Variants

Choose variant from ring, bars, dots or orbit.

<Spinner variant="bars" />
<Spinner variant="dots" />
<Spinner variant="orbit" />

Size and color

The spinner draws with currentColor and is size-4 by default. Change both with utility classes.

<Spinner className="size-6 text-primary" />

Inside a button

Add data-icon="inline-start" or data-icon="inline-end" and leave out size classes so the button sizes it. Set aria-hidden when the button text already says it is busy.

<Button disabled>
  <Spinner data-icon="inline-start" aria-hidden="true" />
  Saving
</Button>

Motion preferences

speed multiplies the playback rate together with the page tempo. Reduced motion keeps the spinner moving, only slower, so it still signals progress.

API Reference

Spinner

Zero-dependency accessible SVG loading indicator powered by WAAPI animations that honor speed, tempo scaling, and prefers-reduced-motion slowdowns.

PropTypeDefaultDescription
variant"ring" | "bars" | "dots" | "orbit""ring"Selects breathing ring arc, 8 radial spokes, 3-dot wave, or counter-rotating orbits.
speednumber1Playback speed multiplier combined with KineticProvider tempo.
label / aria-labelstring"Loading"Accessible status announcement omitted automatically when aria-hidden='true' is passed.

Notes

When placing Spinner inside Button, add data-icon='inline-start' or 'inline-end' and omit explicit size-* classes so Button icon selectors size it automatically.