Skip to content

Spinner

Status: stableAccessibility reviewedtenet-ui@0.4.0
Import
import { Spinner } from 'tenet-ui';

Also accepts every prop of HTMLAttributes<HTMLSpanElement>.

Source: src/components/Spinner/Spinner.tsx

When to use: an indeterminate wait where you can’t show progress (loading a panel, submitting). If you know the proportion done, use a progress bar instead; for content placeholders, prefer a skeleton.

  • It renders role="status" with a visually-hidden label — keep the label meaningful (“Loading repositories”) so screen-reader users hear what’s pending.
  • It inherits currentColor, so place it inside text of the right color (e.g. inside a Button it picks up the button text color) rather than restyling it.
  • Don’t block the whole screen with a bare spinner for long waits — pair it with context or a skeleton.
  • <Spinner label="Loading repositories" />
  • ✅ inside a button: <Button disabled><Spinner size="small" /> Saving…</Button>
  • ❌ A spinning <div> with no role/label — invisible to assistive tech.

See also: Skeleton and ProgressBar; system guideline data-display (loading rules).

3 stories for Spinner — open in Storybook
  • Default components-spinner--default
  • Small components-spinner--small
  • Large components-spinner--large

The full matrix (all args, controls, accessibility panel) is in Storybook.

PropTypeDefaultDescription
size'small' | 'medium' | 'large'
SpinnerSize
mediumSize from the scale.
labelstringLoadingAccessible label announced to assistive tech (visually hidden).