Loading component…
Loading component…
A multi-agent run drawn as a metro map – every agent a line, every step a station, lines meeting at an interchange where work is handed over, a train riding each one.
To reuse this local React demo, copy all files from the Code tab into the same folder, then import AgentMetroMap from ./agent-metro-map.
import { AgentMetroMap, type MetroLine, type MetroStation } from "@/components/ui/agent-metro-map";
const stations: MetroStation[] = [
{ id: "brief", label: "Brief", col: 0, row: 1 },
{ id: "split", label: "Split work", col: 1, row: 1 },
{ id: "code", label: "Write fix", col: 2, row: 0, labelSide: "above", tools: [{ name: "GitHub", logo: <GitHubLogo /> }] },
{ id: "notes", label: "Draft notes", col: 2, row: 2 },
{ id: "review", label: "Review", col: 3, row: 1 },
{ id: "prod", label: "Production", col: 4, row: 1, status: "waiting" },
];
const lines: MetroLine[] = [
{ id: "planner", name: "Planner", model: "Claude Opus 5.5", logo: <ClaudeLogo />, stations: ["brief", "split", "review", "prod"], at: "review", status: "running" },
{ id: "coder", name: "Coder", model: "GPT-5.5 Codex", logo: <OpenAILogo />, stations: ["split", "code", "review"], status: "done" },
{ id: "writer", name: "Writer", model: "Gemini 3 Pro", logo: <GeminiLogo />, stations: ["split", "notes", "review"], at: "notes", status: "running" },
];
export function Release() {
return <AgentMetroMap title="Ship v2.4" lines={lines} stations={stations} onApprove={(s) => api.approve(s.id)} />;
}| Name | Type | Default | Description |
|---|---|---|---|
| stations | MetroStation[] | { id, label, col, row, labelSide?, status?, detail?, tools?, duration? } – col and row place it on the map's grid | |
| labelSide | "below" \| "above" \| "left" \| "right" | Where its name should go – below by default; if a line leaves on that side or another name sits there, it moves to the next free spot around the station | |
| status (station) | "waiting" \| "failed" | Waiting turns amber and can be approved in its card, failed turns red; done and current follow from where the trains are | |
| lines | MetroLine[] | { id, name, stations, at?, status?, color?, model?, logo? } – one per agent, its stations in order | |
| at | string | The station its train is at – the stretch behind is the full color, the stretch ahead see-through | |
| status (line) | "running" \| "done" \| "idle" | Idle – not started, no train; done – arrived, the whole line in full color | |
| color / model / logo | string / string / ReactNode | The line's color – the first is blue, then a palette – and the model with its maker's logo, in the legend and the line's card | |
| onApprove / onReject | (station) => void | Show Approve and Reject in the card of a waiting station – the card closes after either | |
| onSelect | ({ station } \| { line } \| null) => void | A station's or a line's card opened or closed | |
| title / className | string | The heading and the section's accessible name, and an extra class on the root |
Fills its container's width – the columns spread out up to a comfortable distance
Short of room the whole map scales down to fit – it never scrolls sideways
Lines run straight and bend at 45°; at a station a line always runs through its middle
Lines between the same two stations run side by side, like on a real metro map; a line passing a station it doesn't stop at is drawn through it – lay stations so lines don't run over each other
Stations without a place on the grid, lines' stops that don't exist and repeated ids are left out; a train whose station doesn't exist starts at the first one
Station names go where no line leaves the station and no other name sits – eight spots around it – on a patch of the card's color; long names end in …
Cards open below what you clicked, above it near the bottom of the screen
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"