structyl

Spinner

stable

A status indicator for pending work.

Basic usage

LoadingLoadingLoadingLoading large preview

Examples

Loading button

Embed a Spinner inside a Button to indicate an async action in progress.

Sizes and labels

Use different sizes and labels for button, inline and page-level loading states.

Loading small actionLoading contentLoading page sectionLoading full page

Semantic colors

Color prop applies semantic tints to the spinner for contextual loading states.

primary loadingsecondary loadingerror loadingwarning loadinginfo loadingsuccess loading

Features

  • Announces loading state with role="status".
  • Four token-driven sizes.
  • Accepts a custom screen-reader label.

Installation

bash
pnpm dlx structyl add spinner

API Reference

Spinner

A loading status indicator.

PropTypeDefault
size'sm' | 'md' | 'lg' | 'xl'

Visual size.

'md'
labelstring

Visually hidden label announced to assistive technology.

'Loading'
classNamestring

Additional Tailwind classes, merged with the component defaults.

Spinner | structyl