Loading component…
Loading component…
A task passed from agent to agent like a relay – at every handoff what went along to the next one, and what got lost on the way.
To reuse this local React demo, copy all files from the Code tab into the same folder, then import AgentHandoff from ./agent-handoff.
import { AgentHandoff, type HandoffAgent, type Handoff } from "@/components/ui/agent-handoff";
const agents: HandoffAgent[] = [
{ id: "research", name: "Researcher", model: "Opus 5.5", avatar: <ClaudeLogo /> },
{ id: "writer", name: "Writer", model: "GPT-5", avatar: <OpenAILogo /> },
];
const handoffs: Handoff[] = [
{
id: "launch-1", from: "research", to: "writer", task: "Launch post",
items: [
{ id: "brief", label: "launch-brief.md", kind: "file" },
{ id: "quotes", label: "3 user quotes", kind: "note", lost: true, why: "Over the writer's context budget" },
],
},
];
<AgentHandoff
agents={agents}
handoffs={handoffs}
tasks={[
{ id: "launch", title: "Launch post", logo: <NotionLogo />, status: "working", agent: "writer", note: "Drafting" },
{ id: "pricing", title: "Pricing page copy", logo: <NotionLogo />, status: "todo" },
]}
onAssign={(task, agent) => run(task.id, agent.id)}
onRestore={(handoff, item) => passOn(handoff.id, item.id)}
/>| Name | Type | Default | Description |
|---|---|---|---|
| agents | HandoffAgent[] | In relay order: { id, name, model?, avatar?, description? } – each card shows what it's for and the task it's on, taken from tasks | |
| handoffs | Handoff[] | What was handed over: { id, from, to, task, items } – each lands as a card in the column between from and to, latest on top; a new id sends light along its lines | |
| onAssign | (task, agent) => void | A handoff card was dropped on an agent to the right of its column – give that task to it and keep handoffs and tasks up to date. Cards only move on down the relay, never back | |
| onRestore | (handoff, item) => void | Adds "Add back" to a lost item's card – pass it on after all | |
| className | string | Extra class on the root |
Below about 760px the status shows as an icon only; below 620px the relay stacks into one column – an agent, its handoff, the next agent
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"