Skip to content
caliper ui docs

Pro

Flow diagram

A labelled node-and-edge diagram where packets travel along active connections.

Pro
pnpm dlx shadcn@latest add @caliper/flow-diagram

Checkout · production

How a card payment travels between services right now

  • Web to API, active
  • API to Payments: charge, active
  • API to Backup
Installs components/ui/flow-diagram.tsxDepends on none beyond ReactMotion shared motion tokens

When to use

Use it for

  • Explaining how a request or payment moves between services.
  • Showing which part of a system is healthy, degraded or down.

Skip it when

  • 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.

Usage

Import it from your copy of the source. The example behind the preview comes with the source.

example.tsx
import { FlowDiagram } from "@/components/ui/flow-diagram"

The worked example comes with Pro

The 39-line example behind the preview opens here, ready to copy.

  • 626 Pro parts, blocks and page templates, all with source
  • $149 once, with lifetime updates. No renewal
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

FlowDiagram

component
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—

Accessibility

It exposes region semantics, with aria-label, aria-hidden and aria-pressed kept in step with state.

KeyBehaviour
EscapeCloses or cancels, then returns focus to where it came from.

Motion

Transitions use the shared duration and easing tokens. Under prefers-reduced-motion those tokens collapse to instant and travel distances go to zero, so state changes still happen without movement.

All Diagrams examples