Skip to content
Fleetline

Spinner

Usage

Use a spinner for short waits (about 1–5 seconds) where you can't show progress or the shape of the result: checking a VIN, assigning a mechanic, refreshing a vehicle's location. It fades in only after 320ms, so fast responses never flash a loader.

Anatomy

  1. Container — .spinner[role="status"]
  2. Ring — .spinner__ring, aria-hidden
  3. Label — .sr-only text, or visible .spinner__label
  4. Inline spinner — .inline-spinner, 1em, current text color

Examples

Spinner

Refreshing location of KX-24…
Loading service history…
Loading depot map…
Checking VIN 1FTBW3XM6HKA38291…
Loading service history…
<div class="spinner" role="status">
  <span class="spinner__ring" aria-hidden="true"></span>
  <span class="sr-only">Loading service history…</span>
</div>
<div class="spinner spinner--sm | spinner--lg" role="status">…</div>

<!-- Visible label -->
<div class="spinner spinner--labelled" role="status">
  <span class="spinner__ring" aria-hidden="true"></span><span class="spinner__label">Checking VIN…</span>
</div>

Inline spinner

Assigning Lee Park to WO-1042…

Checking availability

<!-- The label changes to say what's happening; the spinner is decorative -->
<button type="button" class="btn btn--secondary" aria-disabled="true">
  <span class="inline-spinner" aria-hidden="true"></span>
  <span class="btn__label">Assigning mechanic…</span>
</button>
<span class="sr-only" role="status">Assigning Lee Park to WO-1042…</span>

<!-- Keep the label and width stable instead: the button's own loading state -->
<button type="submit" class="btn btn--primary" aria-busy="true" aria-disabled="true">
  <span class="btn__label">Save work order</span><span class="btn__spinner" aria-hidden="true"></span>
</button>

API

HookValuesPurpose
.spinner[role="status"]blockContainer and live region
.spinner--sm | --lgmodifier16px / 40px (24px default)
.spinner--labelled (+ .spinner--stacked)modifierVisible label beside (or below) the ring
.spinner__ring | __labelpartsRing and visible label
.inline-spinnerblock1em ring in text or controls; always aria-hidden

Do and don't

Loading service history…
Do say what is loading.

Six spinners in a dashboard, one per card.

Don't fill a page with spinners. Use skeletons for content areas.

Accessibility

Tokens

Custom propertyPurpose
--color-action-primary-bgRing color
--icon-size-sm | -lg, --size-control-mdSizes sm / md / lg
--border-width-thickRing stroke
--motion-duration-slowReveal delay
--motion-duration-slowerRotation period (× 1.6)