Spinner
An indeterminate loading indicator. Inside a button it sits alongside the label rather than replacing it, so the width does not jump.
Purpose
Use a Spinner when the wait is real but unmeasurable — a save in flight, a search running. When you can measure it, or the wait has a shape, reach elsewhere:
Use it for
- A pending action inside its button ("Saving…")
- A block of content that is fetching
- Short, unmeasurable waits
Sizes
sm is a neutral 16px ring for dense UI — buttons, table cells. md and lg are the brand
motion tier: the HMS triangle mark draws itself, a dash chasing the path over a faint track.
Colour comes from currentColor, so set a text colour on the wrapper.
In a button
The spinner sits beside the label, never in place of it — the button keeps its width, and the words say what is happening.
Block loading state
For a loading region, centre a brand-size spinner and say what is loading.
Loading claims…
Structure
| Property | Value |
|---|---|
| Sizes | 16px sm · 24px md · 40px lg |
sm | 2px ring in currentColor with a transparent top, continuous spin |
md/lg | HMS triangle mark, stroke-drawn: a 60-unit dash chasing the path (--animate-brand-draw) over a 20%-opacity track |
| Colour | currentColor — set a text colour on the wrapper (e.g. text-primary-strong) |
| Motion | Under prefers-reduced-motion the animation stops; the mark renders static |
Best practices
Do
- Pair it with words wherever space allows — "Saving…", "Loading claims…".
- Set
labelto the actual activity ("Saving", "Searching") — it is what screen readers hear. - Use
sminside buttons and table cells; reservemd/lgfor block loading states. - Disable the owning button while it shows a spinner.
Don't
- Replace a button's label with a spinner — the width jumps and the meaning disappears.
- Use a spinner where the layout of the incoming content is known — Skeleton holds the space better.
- Use it for measurable progress — that is Progress.
- Show several spinners in one view; one per loading region at most.
Accessibility & keyboard
- Renders
role="status"witharia-label(default "Loading") — screen readers announce it politely without interrupting. - The animated visuals are
aria-hidden; only the label is exposed. - Honours
prefers-reduced-motion: the animation stops and the mark renders static. - Not focusable and has no keyboard interaction — it is pure status output.
Props
Spinner also accepts every native <span> attribute.
| Prop | Type | Default | Description |
|---|---|---|---|
size | "sm" | "md" | "lg" | undefined | "md" | Visual size: `sm` (16px), `md` (24px), `lg` (40px). All sizes use the brand triangle mark with a stroke-draw animation — the "peak" draws itself. `sm` carries a slightly heavier relative stroke so the mark keeps its weight in dense UI (buttons, table cells). |
label | string | undefined | "Loading" | Accessible label announced to screen readers. |