// preview in
saved for every page

Spinner

Shows that something is loading when you can't say how long it will take. It announces its label to screen readers and inherits the text color and size.

Pattern ARIA statusServer componentSource ↗

Installation

Set up Camaleo once (Installation), then import it. It renders on the server.

import { Spinner } from "@camaleo/react";

Anatomy

A role="status" wrapper with the spinning ring and a visually hidden label.

◌Loading
role="status"[data-slot="spinner"]label (visually hidden)

Examples

minimal · light · #3fa34d
Loading
LoadingLoadingLoading

Sizes

It is 1em wide, so it follows font-size. Inside text it matches the line.

LoadingLoading

Color

It draws in currentColor. Set color with a token so it keeps contrast in every skin.

Loading results…

With visible text

When the text is on screen, hide it from assistive tech (aria-hidden) so the status isn't read twice.

Checking 3 of 12 files…

Inside a sentence

Next to text it follows the line height. Say how far along it is when you know it ("3 of 12").

In a button

Don't place a spinner by hand inside a button — use Button loading, which keeps the width and the focus.

Checking availability…

Checking a field

A spinner in the field description while the value is validated on the server.

In context

Recent orders

Loading orders
Loading a listCard · Skeleton · Spinner
Uploading report.pdf

Uploading report.pdf

2.4 MB · about 10 seconds

Upload in progressCard · Spinner · Text
Loading
Page loadingSpinner

Guidelines

Syncing
DoSay what is loading.

"Syncing" is better than a generic "Loading" — and the label is what screen readers hear.

Processing video — 42%
Don’tA spinner for a long task you can measure.

If you know the percentage, show it.

Processing video — 42%
x
DoUse Progress when you know how far along it is.

People wait better when they can see the end.

Recent orders

Loading orders
DoPair it with skeletons for content.

The skeleton shows the shape of what is coming; the spinner says it is on its way.

Props

PropTypeDefaultDescription
labelReactNode"Loading" (or the `MessagesProvider` text)Announced to screen readers through role="status".

Every <span> attribute passes through: style, className, aria-*.

Styling hooks

Attributes

data-slot"spinner" (the ring)
role"status" (the wrapper)

Tokens it reads

This component only

--cml-spinner-ease

Accessibility

—Not focusable. It only announces its label.
Was this page helpful? · Edit this page on GitHub