Skip to documentation content

Flowchart

Lay out an agent workflow as a sequence of steps joined by connectors.

flowchart-demo

Overview

Flowchart shows a workflow from top to bottom: a trigger, a condition, an action. Each step is a card with a kind, a title, and a caption, and any controls you put inside it.

It is a layout, not an editor. The steps are in the order you render them and cannot be dragged. The Beautiful UI original let cards be dragged around a canvas, which has no keyboard equivalent and stores nothing, so it is left out.

Anatomy

Flowchart
  • FlowchartThe dotted canvas and the ordered list of steps
  • FlowStepOne step: a kind, a card, and the connector above it
  • ChildrenYour controls for the step

flowchart has no registry dependencies.

Behavior

Order

Steps are stacked in the order you render them, with a connector above every step but the first.

Step content

title and caption are optional. A step's children are placed in its card under them, for a condition's fields or a summary of what an action will do.

Accessibility

The flow is an ordered list named by label, so the sequence is available without the connectors, which are decoration. Each step's kind is text.

Flowchart has no keyboard interaction of its own. Controls you place in a step keep theirs.

Installation

npx honestui@latest add https://ai.honestui.com/r/flowchart.json

Usage

import { Flowchart, FlowStep } from "@/components/ai/flowchart"

<Flowchart label="Invoice follow-up workflow">
  {workflow.steps.map((step) => (
    <FlowStep key={step.id} kind={step.kind} title={step.title} caption={step.summary} />
  ))}
</Flowchart>

Examples

A step with controls

The condition step holds a Select. Its value is yours to store.

flowchart-controls

API reference

Flowchart

Accepts native ol props beyond those listed. Its children are the steps.

PropTypeDefaultDescription
labelstringRequiredNames the workflow.

FlowStep

Accepts native li props beyond those listed.

PropTypeDefaultDescription
kindstringRequiredThe step's role in the flow.
titleReactNodeNoneWhat the step does.
captionReactNodeNoneOne line under the title.