fractalsvelte mascot fractalsvelte fractalsvelte

Svelte 5 component · machines-ui · Animated

GraphLife

Conway's Game of Life in block glyphs, framed. Alive is accent, the dead leave a faint trail.

Install

GraphLife is a Svelte 5 animated ASCII life component in @fractaldesign/machines-ui. It works in SvelteKit and in any Svelte 5 app.

pnpm add @fractaldesign/machines-ui

Import

import
import '@fractaldesign/machines-ui/style.css';
import { GraphLife } from '@fractaldesign/machines-ui';

Usage

Example
<GraphLife title="LIFE" />

Props

NameTypeDefault
title string Caption drawn on the top edge as `[ TITLE ]`.—
cols number Columns of the board. Default 44.44
rows number Rows of the board. Default 14.14
density number Random fill probability when no `seed` is given. Default 0.28.0.28
seed boolean[][] Explicit initial board. Padded/cropped to `cols` x `rows`.—
seedNum number PRNG seed for the random board, reproducible. Default 7.7
speedMs number Milliseconds per generation. Default 220.220
animated boolean Start playing on mount. Default true. Reduced motion starts paused.true
showControls boolean Show the playback controls. Default true.true
corner string Character at each corner of the frame. Default "+".—
class string ''