Life
Conway's Game of Life in block glyphs, framed. Alive is accent, the dead leave a faint trail.
Install
pnpm add @fractaldesign/machines-ui import '@fractaldesign/machines-ui/style.css';
import { GraphLife } from '@fractaldesign/machines-ui';Preview
gen 000 · pop 152
<GraphLife title="LIFE" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title* | string | — | Caption drawn on the top edge as `[ TITLE ]`. |
| cols | number | 44 | Columns of the board. Default 44. |
| rows | number | 14 | Rows of the board. Default 14. |
| density | number | 0.28 | Random fill probability when no `seed` is given. Default 0.28. |
| seed | boolean[][] | — | Explicit initial board. Padded/cropped to `cols` x `rows`. |
| seedNum | number | 7 | PRNG seed for the random board, reproducible. Default 7. |
| speedMs | number | 220 | Milliseconds per generation. Default 220. |
| animated | boolean | true | Start playing on mount. Default true. Reduced motion starts paused. |
| showControls | boolean | true | Show the playback controls. Default true. |
| 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 |
|---|---|---|
| ArtSeg | interface |
Theming
CSS custom properties this component reads.
- --border
- --graph-accent
- --text-muted
- --text-primary
- --text-secondary
Related
Built from
src/lib/components/animated/GraphLife.svelte