structyl

Spinner API

View component

The full prop reference for the Spinner component. A status indicator for pending work.

Import

tsx
import { Spinner } from '@structyl/styled';

Props

Spinner

A flexible loading spinner component with multiple animation variants (border, dots, pulse, bars), size and color customization, and built-in accessibility features (role=status, aria-live=polite, sr-only label).

PropTypeDefault
variant#'border' | 'dots' | 'pulse' | 'bars'

Animation style: border-based spinner, bouncing dots, pulsing circle, or animated bars

'border'
size#'xs' | 'sm' | 'md' | 'lg' | 'xl'

Size of the spinner (xs=3, sm=4, md=6, lg=8, xl=12 in tailwind size units)

'md'
color#'primary' | 'secondary' | 'success' | 'warning' | 'destructive' | 'error' | 'info' | 'muted' | 'inherit'

Color theme using semantic color tokens

'primary'
label#string

Accessible label text hidden visually but available to screen readers

'Loading'
className#string

Additional CSS classes to merge with component styles

ref#React.Ref<HTMLSpanElement>

Forwarded ref to the underlying span element

Source code

If you didn't find what you need here, read the component implementation .

structyl — Accessible React Component Library