fractalsvelte mascot fractalsvelte fractalsvelte

Svelte 5 component · machines-ui · Graphs

GraphFlow

One or more rows of labelled nodes joined by arrows, with an accent path for the live branch and muted nodes for what trails it.

Install

GraphFlow is a Svelte 5 ASCII flow chart 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 { GraphFlow } from '@fractaldesign/machines-ui';

Usage

Example
<script lang="ts">
	import { GraphFlow, type GraphFlowRow } from '@fractaldesign/machines-ui';

	const rows: GraphFlowRow[] = [
	  { nodes: [{ label: 'tap' }, { label: 'server' }, { label: 'update' }] },
	  {
	    nodes: [
	      { label: 'tap' },
	      { label: 'update', tone: 'accent' },
	      { label: 'server syncs', stretch: true, tone: 'muted' }
	    ]
	  }
	];
</script>

<GraphFlow title="OPTIMISTIC UI" {rows} />

Props

NameTypeDefault
title string Caption drawn on the top edge as `[ TITLE ]`. Uppercase, 1–2 words.—
rows GraphFlowRow[] Flow rows, top to bottom; each row is a sequence of nodes.—
palette GraphPalette How many accent colours the graph uses: `mono` one, `duo` two, `multi` three.—
corner string Character drawn at each corner of the frame.—
class string ''