Skip to content

Spinner

Edit on GitHub
@volvo-cars/css v2.3.0

The spinner uses a native <progress> element with a rotating border animation to indicate loading. It inherits currentColor so it automatically matches the surrounding text color.

<progress class="spinner" aria-label="Loading"></progress>

Apply the spinner class to a <progress> element. Always include an aria-label for screen readers.

<progress class="spinner" aria-label="Loading"></progress>

Control the size with width utility classes. The border thickness scales proportionally.

<div class="flex items-center gap-24">
<progress class="spinner w-16" aria-label="Loading"></progress>
<progress class="spinner w-24" aria-label="Loading"></progress>
<progress class="spinner w-32" aria-label="Loading"></progress>
<progress class="spinner w-40" aria-label="Loading"></progress>
<progress class="spinner w-48" aria-label="Loading"></progress>
</div>
ClassSize
w-1616 px
w-2424 px
w-3232 px
w-4040 px
w-4848 px
40 px (default)
  • Always add aria-label (e.g. "Loading") so screen readers announce the purpose
  • Set aria-busy="true" on the container that is loading content
  • Use aria-live="polite" regions to announce when loading completes
<div aria-busy="true" aria-label="Loading results">
<progress class="spinner" aria-label="Loading"></progress>
</div>
ClassDescription
spinnerAnimated circular progress indicator
w-1616 px spinner
w-2424 px spinner
w-3232 px spinner
w-4040 px spinner
w-4848 px spinner

The spinner respects prefers-reduced-motion through the CSS animation system.