Spinners
A framed text spinner with built-in or custom frames and an optional loading label.
Install
pnpm add @fractaldesign/machines-ui import '@fractaldesign/machines-ui/style.css';
import { GraphSpinners } from '@fractaldesign/machines-ui';Preview
▁ loading tiles<GraphSpinners title="FETCH" kind="bounce" label="loading tiles" speedMs={90} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title* | string | — | Caption drawn on the frame's top edge as `[ TITLE ]`. |
| kind | SpinnerKind 'slash''dots''bounce''bar' | 'dots' | Which glyph spinner to show. Default 'dots'. |
| label | string | 'loading' | Text shown after the spinner. Default 'loading'. |
| speedMs | number | 120 | Milliseconds per frame. Default 120. |
| frames | string[] | — | Custom frame set. Overrides `kind` when non-empty. Padded to equal width. |
| animated | boolean | true | Animate the frames. Default true. Reduced motion holds frame 0. |
| corner | string | — | Character at each corner of the frame. Default '+'. |
| class | string | '' |
API
- class forwarded to the outer element
- motion runs live; set animated={false} to freeze
- a11y honours prefers-reduced-motion
Types
| Name | Kind | Description |
|---|---|---|
| SpinnerKind | type | Which built-in glyph spinner to show. 'slash' | 'dots' | 'bounce' | 'bar' |
Theming
CSS custom properties this component reads.
- --graph-accent
- --text-secondary
Related
Built from
src/lib/components/animated/GraphSpinners.svelte