Spinner

Loading spinner components for indicating ongoing processes and operations.

Variants

Three spinners for different surfaces. Each takes a size in pixels.

BlueSpinner
GraySpinner
GraySpinner2

Blue spinner

BlueSpinner is a blue arc for primary loading states.

16px (default)
24px
32px
48px

Gray spinner

GraySpinner is a ring of bars in the current text color.

16px (default)
24px
32px
48px

Gray spinner 2

GraySpinner2 is a compact ring with a gradient head, used in most loading affordances.

16px (default)
24px
32px
48px

In context

Pair a spinner with a short status line that says what is loading.

Running 128 prompts…
Uploading brand-guidelines.pdf…
Generating report…

Accessible label

Spinners are hidden from assistive technology by default. Pass label when the spinner is the only sign that something is loading. The spinner then renders with role="status" and the label as its accessible name.

Centered

CenteredSpinner centers a GraySpinner2 in an area whose content has not rendered yet. It fills the parent's width and height, with a minimum height of 160px. Pass flex-1 to fill a flex parent, or min-h-0 when the parent sizes itself.

Properties

BlueSpinner
Component

Blue colored spinner component

GraySpinner
Component

Gray colored spinner component

GraySpinner2
Component

Compact gradient spinner component

CenteredSpinner
Component

GraySpinner2 centered in a full-width box with a 160px minimum height

size
number

Size of the spinner in pixels

Default: 16

className
string

Additional CSS classes to apply to the spinner. On CenteredSpinner, applies to the wrapper.

label
string

Accessible name. When set, the spinner renders with the status role. When omitted, it is hidden from assistive technology.

aria-label
string

Alias for label. label wins when both are set.

style
CSSProperties

Inline styles for GraySpinner2 (e.g. to sync animation timing)

ref
Ref<SVGSVGElement>

Ref forwarded to the GraySpinner2 SVG element