Skip to content
Storybook

Spinner

Indeterminate loading indicator used by every Pending state.

Preview

React · live from the Storybook

HTML and CSS

The same component as plain HTML with pixels-ui.css, no framework needed.

Usage

  • Brand on light surfaces, On color on filled buttons.

Installation

Included in the core files. No extra install.

HTML
<link rel="stylesheet" href="/css/pixels-tokens.css">
<link rel="stylesheet" href="/css/pixels-ui.css">
<script src="/js/pixels-ui.js" defer></script>

API reference

Class / attributeTypeDescription
px-spinner--sm · --lgclassSize.
px-spinner--neutral · --on-color · --dangerclassTone.

Figma properties

Spinner12 variants · page “Progress Bar”Open

Indeterminate loading indicator used by every Pending state. Tone follows the surface: Brand on light surfaces, On color on filled buttons.

PropertyTypeValues
SizeVariantSmall Medium Large
ToneVariantBrand Neutral On color Danger

Design tokens

Component tokens from the Figma Component collection. Override them to restyle just this component.

TokenAliasLight value
--px-spinner-brand-trackcolor-border-brand-subtle#bfdbfe
--px-spinner-brand-indicatorcolor-border-brand-default#2563eb
--px-spinner-neutral-trackcolor-border-neutral-subtle#f2f4f7
--px-spinner-neutral-indicatorcolor-content-neutral-secondary#475467
--px-spinner-on-color-trackcolor-border-on-color-subtle#ffffff4d
--px-spinner-on-color-indicatorcolor-content-on-color#ffffff
--px-spinner-danger-trackcolor-border-danger-subtle#fecdca
--px-spinner-danger-indicatorcolor-border-danger-default#f04438

Accessibility

  • role="status" with an aria-label.