State
A four-state machine drawn in ASCII — ready, think, act, done — with the current state and its outgoing transition highlighted.
Install
pnpm add @fractaldesign/machines-ui import '@fractaldesign/machines-ui/style.css';
import { GraphState } from '@fractaldesign/machines-ui';Preview
state machine, stepping through
<GraphState title="AGENT" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title* | string | — | Caption drawn on the top edge as `[ TITLE ]`. Uppercase, 1–2 words. |
| animated | boolean | true | Animate the state cycle. Default true. Reduced motion freezes on the start state. |
| speedMs | number | 700 | Milliseconds per state step. Default 700. |
| label | string | 'state machine, stepping through' | Short caption under the art; the chart itself is the message. |
| 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 |
|---|---|---|
| State | interface | |
| Transition | interface | |
| Seg | interface |
Theming
CSS custom properties this component reads.
- --graph-accent
- --text-primary
- --text-secondary
Related
Built from
src/lib/components/animated/GraphState.svelte