Skip to content
Mosaic
On this page

Spinner

Indeterminate loading spinner, sized to match an Icon. Decorative (aria-hidden) by default; with label it is a progressbar named by the label.

Use for

  • an indeterminate loading indicator
  • a spinner standing in for an icon

Practices

GuidancePractice
DoPass a localized label when the spinner is the only sign of progress.
Don’tRender a spinner inside a button by hand. Use SubmitButton instead.
Don’tShow it as soon as work starts. Gate it with useSpinDelay so it does not flash.

API reference

Spinner

Renders a span and forwards its ref. Carries data-size.

Slot: cl-spinner

PropTypeDescription
size'sm' | 'md'sm or md, matching the Icon sizes.Default: 'md'
labelstringAccessible name. Makes the spinner a progressbar instead of decorative.

Examples

Decorative

TSX
<Spinner />

Announced

TSX
<Spinner size='sm' label={t('loading')} />