Ballmac UI home

Agent Tree

New

Who handed work to whom: an orchestrator and the agents it delegated to as a tree, each with its state in words, model, rolled-up progress and cost, a header that adds it up, and the full tree keyboard model.

v1.0.0Updated Oct 25, 2026Ships with a test
What changed
Market research7 agents4 running1 waiting$0.32
OrchestratorResearch the CRM market for a 10-person sales team and write a one-page brief.Running
Pricing researcherCollect current plan prices from six vendors.Running
Web searchFind each vendor's pricing page.Done
Page readerRead the six pricing pages and pull out the plans.Running
Review analystSummarise what customers say about setup and support.Running
Brief writerWrite the brief once the research is in.Queued
Fact checkerCheck every price and claim against its source.Waiting

Page readerRunningHaiku 5.5

Read the six pricing pages and pull out the plans.

1 min 20 s · 9,800 tokens · $0.030

Installation

$ pnpm dlx shadcn@latest add @ballmac/agent-tree

Usage

import { AgentTree, flattenAgents, agentProgress } from "@/components/ballmac/agent-tree"

The full example is in the Code tab above.

Examples

A failed branch

Release 2.45 agents1 running2 failed$0.33
Release agentPrepare and ship version 2.4.Running
Test runnerRun the unit and end-to-end suites.Done
Release notesWrite the changelog from merged pull requests.Done
DeployerDeploy to staging and check the health endpoint.Failed
Health checkGET /healthz returned 503 three times.Failed

Health checkFailedHaiku 5.5

GET /healthz returned 503 three times.

$0.004

API reference

PropTypeDefault
agents*AgentNode[]—
selected

The selected agent id. Controlled.

string | null—
defaultSelectedstring | nullnull
onSelectedChange(id: string) => void—
defaultCollapsed

Agents whose sub-agents start hidden.

string[][]
title

Heading in the strip above the tree.

string—
currency

ISO currency code for costs.

string"USD"

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
TabEnters the tree once, on the first agent (or the selected one)
Arrow keysUp and Down move; Right opens an agent or goes into it; Left closes it or goes to its parent; Home and End jump
EnterSelects an agent and writes out its task, model, cost and sub-agents below
Screen readersA tree with level, position and expanded state; each name includes the state in words and the task
StateQueued, Running, Waiting, Done and Failed are words with icons, never only colour

Use with AI

agents is [{ id, parentId?, name, task?, status: queued | running | waiting | done | failed, progress?, model?, tokens?, cost?, duration? }] (required); selected / defaultSelected / onSelectedChange, defaultCollapsed (ids), title, currency. A parent without progress shows the average of its sub-agents; the header counts agents, running, waiting and failed, and adds up cost. A real tree: arrow keys, Home, End, Enter. Exports flattenAgents and agentProgress. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Agent Tree (@ballmac/agent-tree) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Showing an orchestrator and the sub-agents it started, and how each is doing
  • A multi-agent run where delegation depth and cost matter

Not for

  • Agents that work side by side on a timeline; use agent-lanes
  • How agents and tools are wired in general; use agent-graph
  • Timing of spans; use trace-waterfall

Registry JSON: https://ui.ballmac.com/r/agent-tree.json

Credits

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.