Flowchart

Workflow trigger and condition steps on a dotted canvas.

Installation

pnpm dlx shadcn@latest add @ward/flowchart

Add the Ward registry to components.json once:

"registries": {
  "@ward": "https://ward.so/r/{name}.json"
}

Or install from the URL with no configuration: npx shadcn@latest add https://ward.so/r/flowchart.json

Usage

import Flowchart from "@/components/ward/Flowchart";
<Flowchart
  steps={[
    {
      id: "trigger",
      row: 0,
      x: 0.5,
      w: 300,
      kind: { label: "Trigger", hue: "#9a5cff" },
      hue: "#9a5cff",
      title: "Form submitted",
      caption: "Trigger when a form is submitted",
    },
    { id: "cond", row: 1, x: 0.5, w: 356, kind: { label: "If / Else", hue: "#f09a2f" }, condition: true },
  ]}
/>

Props

PropTypeDefaultDescription
variantstring"Default"Accepted for registry parity; the component has a single variant.
stepsStepNode[]NODESStep cards placed on the canvas by row and horizontal centre, with the connector drawn from the "trigger" step to the "cond" step.

Ward · Version 1.1.0 · Registry manifest