Flowchart

A React component in Beamline's AI & agents category.

A workflow as steps on a dotted canvas: a trigger, conditions that branch into paths side by side, actions and waits, read top to bottom; during a run each step shows its status, and the whole flow is one keyboard stop walked with the arrows.

Use it for

  • Showing or reviewing an automation an agent will run: trigger, conditions, actions.
  • Following a workflow run step by step, including where it stopped.

Not for

  • A linear list of steps with live status (plan, or task-rows for background jobs).
  • Free-form diagrams or graph editing (a canvas library).
  • Progress through a form (stepper).

Anatomy

  • frame and dotted canvas (scrolls inside its own frame)
  • step node: kind tile and word (Trigger, If / else, Action, Wait), meta, status glyph and word, title, description
  • conditions well: If / and rows, field, operator, value (menu when editable)
  • connector with arrow
  • branch fork: a pill per path (Yes / No) and its steps side by side, or (stacked) one path after another, each on a rail from its pill
  • empty state
  • selection ring: one accent ring over the chosen step that travels to the next choice

Variants

  • kind: trigger, condition, action, wait
  • layout: auto (default: side by side while the room holds every path, stacked when it does not), branches (side by side; the canvas scrolls), stacked (paths one after another, steps the canvas width: side panels)

States

  • definition (no status)
  • selected step (the accent ring travels to it)
  • run: done, running, not run, skipped, failed (outlined, says why)
  • empty

Keyboard

  • The flow is one Tab stop (roving tabindex; the selected step first)
  • ↓ next step (into the first path after a condition), ↑ previous (out of a path to its condition)
  • ← → the same place in the neighbouring path (mirrored in RTL)
  • Home / End first and last step
  • Enter or Space selects the step and calls onStepActivate
  • Condition values are buttons that open a menu

Motion

The selection ring travels from step to step with its leading edge first (glide-2d), and is simply there after a reflow; a step's status mark fades to the new one and its word fades to the new one (Running → Done); hover lifts a node's shadow at once and settles over --pui-motion-out. Changing between side by side and stacked is a stop: the structure changes in place. Reduced motion places the ring at once.

Props

PropTypeDefaultDescription
steps (required)FlowStep[]—Steps displayed in their execution order. Required.
selected / defaultSelected / onSelectedChangestring | null—selected: The step in focus for editing or inspection, controlled or not. defaultSelected: Initial selected ids when uncontrolled. Defaults to null. onSelectedChange: Reports selected ids after a change; no callback by default.
onStepActivate(step) => void—Enter, Space or a click on a step.
onConditionChange(stepId, conditionId, value) => void—A condition's value changed from its menu.
label / emptyLabel / heightstring / ReactNode / number | string—label: The workflow's name, for assistive tech. Default "Workflow". emptyLabel: Said when there are no steps. height: Canvas height; the canvas scrolls inside it. Default fits the content.
style / refCSSProperties / native Ref—style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the documented root element; no ref by default.
classNamesFlowchartClassNames—Classes for the named visual parts; no part overrides by default.
layout"auto" | "branches" | "stacked""auto"branches: paths after a condition sit side by side (the canvas scrolls when they are wider than the room). stacked: paths follow one another, each on its own rail (side panels). auto (default): side by side while the room holds them, stacked when it does not.
styleCSSProperties—Inline styles on the documented visual root; no inline overrides by default.
selectedstring | null—The step in focus for editing or inspection, controlled or not.
defaultSelectedstring | null—Initial selected ids when uncontrolled. Defaults to null.
onSelectedChange((id: string | null) => void)—Reports selected ids after a change; no callback by default.
labelstring—The workflow's name, for assistive tech. Default "Workflow".
emptyLabelReactNode—Said when there are no steps.
heightstring | number—Canvas height; the canvas scrolls inside it. Default fits the content.
classNamestring—Classes on the documented visual root; no override by default.
refRef<HTMLDivElement>—Receives the documented root element; no ref by default.

Built from

Used in

Dependencies

lucide-react, radix-ui

Import

import { Flowchart } from "@beamline/flowchart";

Get it

Flowchart is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent

More in AI & agents

  • Image generation: The frame an AI image is generated into: a field of brand-hued pixels breathes with the progress while the model works, then the image arrives —…
  • Run trace: One agent run as a waterfall: every step (model calls, tools, retrieval, checks, sub-agents) nested under the step that started it, each a bar on a…
  • Run theatre: One agent run as a theatre: the Run trace's waterfall under a transport (play, scrub, speed) that replays the run as it happened. Pick a step and re-run…
  • Answer compare: Two answers to the same prompt side by side, and a person's verdict: A is better, a tie, B is better, or both are bad, with the reasons that decided it…
  • Branch navigator: The versions of an assistant conversation that forked when a message was edited or an answer regenerated: a “‹ 2 / 3 ›” switch on each message that has…
  • Response: An assistant's answer as streamed markdown in the system's reading type: bursty tokens flow in at an even pace, each new word fades in through a short…
  • Chat thread: People talking to people: messages grouped by person and day, reactions, delivery and read receipts that glide to the newest message read, who is typing…
  • Model picker: Choose the AI model for a request by what it can do and what it costs: a trigger with the model's name opens a searchable list grouped by provider, with…
  • Task rows: Background work an agent is doing, one row per task: status as a glyph and a word, what it produced, how long it has run or took, a progress bar while…
  • Conversation: The scrolling column of a conversation: follows new content while you are at the bottom, stops when you scroll up to read, and offers a way back; shared…
  • Context cards: The knowledge an agent retrieved before it answered: one card per chunk with what it is about, the text it read with the search words marked, how…
  • Prompt suggestions: Ready-made prompts a person can start from or follow up with: chips, cards or a list; a picked one lifts off and flies into the composer as its text…
  • Plan: An agent's plan: numbered steps with live status, progress, and Approve / Edit / Reject when it needs sign-off; approving shows progress, and a refusal…
  • Approval card: The agent stops and asks before it acts: what it wants to do, exactly what that changes, any choices it needs, and Approve or Reject; both run your…
  • Tool call: One tool call in an agent's run: status, what it did and a short result on one quiet row that opens to the exact input and output; stops for permission…
  • Recommendation card: One suggestion from the agent that the person may take or leave: what it suggests, why, the expected effect and how sure it is (a meter and a word…
  • Citations: Inline numbered citations that preview their source on hover or focus, plus a numbered source list; streamed answers flow in at an even pace with the…
  • Reasoning: The agent's trace, fed by your stream: a shimmering label and the seconds so far while it works, then "Thought for N seconds"; steps that check off…
  • Attachment: A file tile: preview or typed glyph with the type named, name, size, upload progress, error with retry, and a keyboard-reachable remove.
  • Prompt bar: The agent composer: a field that grows, @ to add a source, / for a command, a model picker, files and dictation, and one button that sends with progress…
  • Selection actions: Select a passage and hand it to the agent: a bar over the selection with quick actions, your own instruction and More; while the agent works it says so…
  • Message: One turn in a conversation with an agent: the person's words in a quiet bubble, the agent's answer on the page with its orb mark, trace, tool calls and…

Part of Beamline UI: polished, editable React components and complete screens for custom applications. Build your own style from any look; tokens, fonts, radii, motion; not only colours.