Spinner

Indeterminate circular loading indicator.

Installation

Install with the CLI, or copy the component source into your project.

Add spinner (npm)

npx --yes -p github:itsvigneshv/default-file-ui#main df-ui add spinner

Default

Indeterminate circular spinner at the default size.

Sizes

Ring diameters from xs to lg.

xs
sm
md
lg

Current color

Stroke follows the host text color.

Primary
Destructive
Muted

Properties

Indeterminate circular loading indicator. Uses currentColor so it matches the host text color.

Spinner

PropTypeDefaultNotes
size"xs" | "sm" | "md" | "lg""md"Diameter of the ring.
aria-labelstring"Loading"Accessible name when the spinner is announced. Ignored when the spinner is hidden from assistive tech.
aria-hiddenboolean-Hide from assistive tech when a parent already exposes busy state.
classNamestring-Additional styles.

Tokens

Theme defaults live on :root. Override these globally or on a local host.

TokenTypeDefaultNotes
--df-spinner-size-xsCSS lengthcalc(3 * var(--spacing-unit))xs diameter.
--df-spinner-size-smCSS lengthcalc(3.5 * var(--spacing-unit))sm diameter.
--df-spinner-size-mdCSS lengthcalc(4 * var(--spacing-unit))md diameter.
--df-spinner-size-lgCSS lengthcalc(5 * var(--spacing-unit))lg diameter.
--df-spinner-strokeCSS lengthvar(--border-width-thick)Ring stroke width.
--df-spinner-track-opacitynumbervar(--df-opacity-25)Muted full ring opacity.
--df-duration-spinCSS time1sOne full rotation period.