caliper uidocs

Flow diagram

Pro

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

Installs components/ui/flow-diagram.tsxDepends on none beyond ReactMotion shared motion tokens
pnpm dlx shadcn@latest add @caliper/flow-diagram
  • Web to API, active
  • API to Payments: charge, active
  • API to Backup

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 25-line example behind the preview opens here with a Pro or Team licence.

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.