Playground

Spinner

A small indicator that something is loading.

  • Built on native elements
  • role=status with an aria-label; polite, not interrupting.
  • Animation stops under prefers-reduced-motion.
  • Styles in one file: 13-loading.css

Import

import '@monoline/css';
import {Spinner} from '@monoline/react';

Not installed yet? Pick a route.

Copies the source and its styles into your project.

npx monoline add spinner

Usage

import {Spinner} from '@monoline/react';

<div style={{display: 'flex', gap: 'var(--s3)', alignItems: 'center'}}>
  <Spinner />
  <span className="muted small">Syncing 42 entries</span>
</div>

Examples

Basic

Props

SpinnerProps

PropTypeDefaultDescription
labelstring'Loading'What is loading, read by screen readers.

Data Attributes

State is exposed through attributes. Style it with these selectors, not with class toggles.

This component sets no state attributes.

CSS classes

ClassStylesheet
.skeleton13-loading.css
.skeleton-block13-loading.css
.skeleton-hatch13-loading.css
.spinner13-loading.css

Customization

Style it with the kit's tokens in your own CSS, loaded after @monoline/css. Prefer the attributes above over extra classes. See Theming for every token.

app.css
.skeleton {
  border-color: var(--accent);
}

Accessibility

  • role=status with an aria-label; polite, not interrupting.
  • Animation stops under prefers-reduced-motion.