Flow diagram
A labelled node-and-edge diagram where packets travel along active connections.
- Web to API, active
- API to Payments: charge, active
- API to Backup
When to use
- Explaining how a request or payment moves between services.
- Showing which part of a system is healthy, degraded or down.
When not to use
- The graph is large or user-editable; use a dedicated graph editor.
- A static picture would do; the motion should earn its place.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/flow-diagram
Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
FlowDiagram
10 props
PropTypeDefaultDescription
label *string—
nodes *readonly FlowNode[]—
edges *readonly FlowEdge[]—
headersreadonly { x: number; label: string; }[]—Column titles placed above the canvas.
selectedstring | null—
onSelect((id: string | null) => void)—
pausedbooleanfalse
aspectnumber2Width over height of the canvas.
minWidthnumber900Narrower than this and the diagram scrolls sideways instead of shrinking.
classNamestring—
Keyboard
- Escape
- Closes or cancels, then returns focus to where it came from.
Accessibility
It exposes region semantics, with aria-label, aria-hidden and aria-pressed kept in step with state.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/flow-diagram.mdThe index of every part is at /llms.txt.