Skip to content

Spinner

A rotating indicator for a wait, as a class, or as an element that can also show how far along it is.

  • <aparte-progress-spinner>
  • .aparte-spinner
On this page
Open

.aparte-spinner is a ring that turns, in three sizes (--sm, the default, --lg), for a wait of unknown length: a button that is sending, a list that is loading.

Open

<aparte-progress-spinner> turns while it has no value, and fills its ring to the value (0 to 100) once it has one: a model being downloaded, a file being read.

html
<aparte-progress-spinner value="…"></aparte-progress-spinner>

Installation and the framework-specific traps: React · Vue · Svelte · Angular.

VariableDefaultNote
--aparte-spinner-size-sm12px
--aparte-spinner-size-md16px
--aparte-spinner-size-lg24px
--aparte-spinner-sizevar(--aparte-spinner-size-md)Shared by both spinners the library ships — the display recipe and the &lt;aparte-progress-spinner> element.
--aparte-spinner-thicknessvar(--aparte-space-1)
--aparte-spinner-colorcurrentColor
--aparte-spinner-trackvar(--aparte-border-control)

<aparte-progress-spinner> · class AparteProgressSpinner

Attributes

AttributeDescription
valueProgress percentage 0–100 (omit for indeterminate)

CSS variables

VariableDefaultDescription
--aparte-spinner-sizevar(--aparte-spinner-size-md)Width and height of the element; the SVG fills it.
--aparte-spinner-colorcurrentColorStroke of the filled (progress) arc.
--aparte-spinner-trackvar(--aparte-border-control)Stroke of the track arc behind it.

.aparte-spinner · .aparte-spinner--lg · .aparte-spinner--sm

  • <aparte-progress-spinner> is a progressbar, with its value once it has one. It has no name of its own: give it an aria-label unless the text beside it says what is loading.
  • The .aparte-spinner class is drawing only: put role="status" and a visually hidden label on what it sits in, or let the surrounding text say it.
  • Both stop turning under prefers-reduced-motion.
  • Progress — a bar, when there is room for one.
  • Skeleton — the shape of content that is on its way.