Examples

Sizes and tones

Preview
LoadingLoadingLoading reportLoading
Example.tsx
import { HStack, Spinner } from '@reactloom/ui';

export default function Example() {
  return (
    <HStack gap="8">
      <Spinner size="sm" />
      <Spinner />
      <Spinner size="lg" label="Loading report" />
      <Spinner tone="muted" />
    </HStack>
  );
}

With visible text

When text already announces the state, pass label={null}.

Preview

Syncing 1,284 records…

Example.tsx
import { HStack, Spinner, Text } from '@reactloom/ui';

export default function Example() {
  return (
    <HStack gap="2">
      <Spinner size="sm" label={null} />
      <Text tone="muted" role="status">Syncing 1,284 records…</Text>
    </HStack>
  );
}

API reference

Spinner props
PropTypeDefault
size
'sm' | 'md' | 'lg''md'
tone
'accent' | 'muted' | 'current''accent'
label
Announced to assistive technology; null makes it decorative.
string | null'Loading'

Customization

Extracted from the component’s source on every build, so it matches the code. How the layers fit together is explained in Customization.

State attributes

Target these in your CSS to style states without depending on class names.

AttributeValues
[data-size]sm · md · lg
[data-tone]accent · muted · current

Theme tokens it reads

--pl-color-accent-solid --pl-color-fg-muted

Accessibility

  • Announced once via role="status" when it appears.
  • Animation slows to 2.4 s per turn under prefers-reduced-motion.

Usage guidelines

Do

  • Prefer skeletons for page-level loading (Phase 2).

Don’t

  • Don’t show several spinners that all announce at once.