Spinner
Indicate a short operation without changing layout. CSS only
<span class="ui-spinner" role="status"> <span data-ui-part="label">Loading preview</span></span>Install
import '@timelessui/components/css/tokens.css'import '@timelessui/components/css/spinner.css'Anatomy
Parts are authored in your own markup and identified by the selector below, so your CSS can target the same anatomy without loading Timeless styles. Required parts must be present for the component to work. Private data-ui-internal-* hooks are written by the runtime and must never be authored.
| Part | Required | Selector | Purpose |
|---|---|---|---|
label | No | [data-ui-part~='label'] | Visible or screen-reader-only description of the wait. |
Attributes
Every value below is implemented by the stylesheets this component ships. Boolean attributes are presence-based: author the attribute with no value, or omit it.
| Attribute | Values | Default | Description |
|---|---|---|---|
data-ui-size | sm · md · lg | md | Spinner diameter. |
data-ui-variant | neutral · accent · success · warning · danger | neutral | Indicator color. |
Styling
Root identity: ui-spinner. Required stylesheets: tokens.css, spinner.css.
This component adds no custom properties of its own. Restyle it through the design tokens or your own CSS.
Design tokens this component reads (8)
These are global Atmosphere tokens. Change them once at the theme level rather than per component.
--ui-accent · --ui-danger · --ui-fg · --ui-fg-muted · --ui-radius-pill · --ui-space-2 · --ui-success · --ui-warning
Accessibility
Keep the native elements, roles, and relationships shown in the example. Timeless adds only the state and keyboard coordination the platform does not already provide, and it never supplies your accessible names — those depend on your content.
Before JavaScript runs
This primitive is CSS only. There is nothing to register and nothing to wait for.
More examples
Open Spinner in StoryLite for variants, controls, and manual testing.