Skip to content
Sign in
AgentsAgent hierarchyMenu

Agent hierarchyPro

An orchestrator and its subagents as a live tree, with the reason for each handoff on its edge.

ProAn orchestrator, its subagents and the reason for each handoff, as a keyboard tree.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/agent-hierarchy

Usage

tsx
import { AgentHierarchy } from "@/components/ui/chatcn/pro/agent-hierarchy"

<AgentHierarchy root={orchestrator} onSelect={openAgent} />

Each node shows the agent's state, current step and time. Guide lines show depth; the handoff reason sits on the edge into the child, so you can read why each subagent exists.

Examples

States

ProCollapsed, a single agent and a failed branch.

Props

PropTypeNotes
rootHierarchyNode{ id, name, role?, state, activity?, elapsedMs?, handoff?, children? }
defaultExpandedstring[]Open nodes at first. Default all
selectedId, onSelectstring, (id) => voidSelection

Accessibility

  • A real ARIA tree with roving focus: Up and Down move, Right opens or steps in, Left closes or steps out (mirrored in RTL), Home and End jump, Enter selects.