Loading component…
Loading component…
An org chart of people and AI agents – people own agents, reporting lines run between them, and an escalation travels up to the person who owns the agent
To reuse this local React demo, copy all files from the Code tab into the same folder, then import AgentOrgChart from ./agent-org-chart.
import { AgentOrgChart, type OrgNode } from "@/components/ui/agent-org-chart";
const nodes: OrgNode[] = [
{ id: "lena", kind: "person", name: "Lena Hoffmann", role: "Head of Operations", avatar: "/avatars/lena.jpg" },
{ id: "noah", kind: "person", name: "Noah Bennett", role: "Support lead", avatar: "/avatars/noah.jpg", parent: "lena" },
{ id: "triage", kind: "agent", name: "Triage", model: "Haiku 4.5", logo: <ClaudeLogo />, status: "working", parent: "noah",
tools: [{ name: "Linear", logo: <LinearLogo /> }, { name: "Slack", logo: <SlackLogo /> }] },
{ id: "refunds", kind: "agent", name: "Refunds", model: "Sonnet 4.5", logo: <ClaudeLogo />, status: "idle", parent: "noah",
tools: [{ name: "Stripe", logo: <StripeLogo /> }] },
];
export function Team() {
return <AgentOrgChart title="Operations" nodes={nodes} />;
}| Name | Type | Default | Description |
|---|---|---|---|
| nodes | OrgNode[] | Everyone in the chart – { id, kind, name, parent?, role?, avatar?, model?, logo?, tools?, status?, task?, color? }. kind is person or agent; parent is whom it reports to (a manager, an owner, or the agent a sub-agent runs under) – without it, it sits at the top. People take role and avatar; agents model with its maker's logo (any node, 12px), tools – { name, logo? }, the first three as overlapping white logo tiles, then +N – status (working, waiting or idle), task and color | |
| escalations | OrgEscalation[] | Open escalations – { id, from, to?, label? }. from is the agent; to by default the nearest person above it. A new one travels up the lines; its agent shows waiting, its person an amber strip with the request | |
| onApprove | (escalation: OrgEscalation) => void | Shows Approve on each request in its person's card – remove the escalation to resolve it | |
| onReply | (escalation: OrgEscalation) => void | Shows Reply next to Approve | |
| title | string | The name in the bar – default Org chart | |
| className | string | Extra class on the root – set the color variables on it, e.g. --ui-aoc-p1 |
Wide enough, a tree from the top down; when it doesn't fit, an indented list with the same cards and lines
The cards keep their size in every state; names shorten with an ellipsis
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"