Actions
Spinner
An indeterminate loading indicator. It is a polite status region with a visually hidden label, and slows down under reduced motion.
import { Spinner } from '@reactloom/ui';Examples
Sizes and tones
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}.
Syncing 1,284 records…
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
| Prop | Type | Default |
|---|---|---|
size | 'sm' | 'md' | 'lg' | 'md' |
tone | 'accent' | 'muted' | 'current' | 'accent' |
labelAnnounced 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.
| Attribute | Values |
|---|---|
[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.