Skip to content
StackD
Workflow canvas, the StackD component

Widgets · Free

Workflow canvas

An automation canvas: drag nodes on jelly wires, press Run and the Bot rides them from node to node; conditions branch green or red.

Free on Gumroad: the download arrives in your inbox.

Details

Category
Widgets
Plan
Free
Code
React + Tailwind, TypeScript · 400 lines
Files
WorkflowCanvas.tsx
Needs
The Bot (installed with it)
Agents
MCP server and shadcn registry

About

A small automation canvas: node cards on a dotted board, joined by soft wires. Each wire leaves from the side of the card that faces the next one, so you can lay the flow out any way you like.

Drag a node and its wires follow like jelly: they stretch, overshoot a little and settle. Drag the board to pan.

Press Run and the Bot rides the wires from node to node like a drop of jelly, stretching as it speeds up and squashing as it lands. Each node pulses while it works, then bounces and gets a tick; its duration and last run update. A condition sends the Bot down its true (Olive) or false (Wine) branch and counts it.

React + Tailwind and the Bot, no other libraries.

Install

With the shadcn CLI:

npx shadcn@latest add https://www.stackd.codes/r/workflow-canvas.json

Or let your agent add it through the StackD MCP server:

claude mcp add --transport http stackd https://www.stackd.codes/mcp

Prompt for your agent

Paste it into Claude Code, Cursor, Codex or VS Code once the MCP server is connected.

Add the StackD Workflow canvas component to this project. Use the StackD MCP server: call get_component with { "name": "workflow-canvas" }, write the files at the paths it gives and install any npm packages it lists. Then use it where it fits, following its README for the props, and keep its own styles.

Use

  1. Copy WorkflowCanvas.tsx and Bot.tsx into the same folder (for example components/).
  2. Use it:
import { WorkflowCanvas, type FlowNode, type FlowEdge } from './components/WorkflowCanvas'

const nodes: FlowNode[] = [
  { id: 'trigger', title: 'Schedule trigger', icon: 'clock', x: 30, y: 120,
    rows: [[{ label: 'Cadence', value: 'Every 5 min' }], [{ label: 'Last', value: '14:05' }]] },
  { id: 'http', title: 'HTTP request', icon: 'code', x: 300, y: 210,
    rows: [[{ label: 'GET', value: '/v1/orders' }], [{ label: 'Duration', value: '0.2s' }]] },
  { id: 'cond', title: 'Condition', icon: 'branch', x: 570, y: 100, condition: () => order.total > 100,
    rows: [[{ label: 'If', value: 'total > 100' }], [{ label: 'True', value: '23' }, { label: 'False', value: '14' }]] },
  { id: 'mail', title: 'Send email', icon: 'mail', x: 860, y: 30 },
  { id: 'log', title: 'Log order', icon: 'log', x: 860, y: 250 },
]
const edges: FlowEdge[] = [
  { from: 'trigger', to: 'http' },
  { from: 'http', to: 'cond' },
  { from: 'cond', to: 'mail', branch: 'true' },
  { from: 'cond', to: 'log', branch: 'false' },
]

<WorkflowCanvas nodes={nodes} edges={edges} width={1100} height={460} onStep={async (node) => { await runStep(node.id) }} />

onStep is called as each node runs: resolve when it's done, or throw to stop the run there (that node turns Wine). Rows update by themselves when their label is Duration, Last, or starts with True or False.

In Next.js the files already start with 'use client'. In other React setups that line does nothing.

Options

PropDefaultWhat it does
nodes{ id, title, icon?, x, y, rows?, condition? }. Icons: clock, code, branch, mail, log, bolt
edges{ from, to, branch? }. branch: 'true' | 'false' for a condition's two ways
startfirst nodeWhere a run starts
onStepYour work for each node
theme'light''light' or 'dark'
width / height820 / 440Canvas size in px
nodeWidth228Width of every card
touchScrollfalseOn touch screens, an up or down swipe scrolls the page (for a canvas inside a page)
snapshotHold one moment of a run, for covers: { done: ['a', 'b'], rider: { from, to, at: 0.5 } }
classNameExtra classes

Accessibility

Every node can be reached with Tab and says its state (running, done, failed). The arrow keys move it (Shift for bigger steps) and Enter runs the flow. A live line announces when a run starts and ends. With reduced motion on, nothing wobbles or bounces and the Bot jumps from node to node.

Colours from StackD

White #FFFFFF · Ink #141310 · Wine #901919 · Olive #6C8544 · Ochre #BE9344 · Lilac #C9B8FF

Licence

You can use it in personal and commercial projects. Don't resell or share the component on its own.