Planning & Execution
Background Agents Panel
Agents working in the background as a grid of live tiles or a compact dock that expands into the selected agent.
2 variantsMIT
Preview
Installation
Copies the component into components/ui and installs its dependencies and theme tokens.
pnpm dlx shadcn@latest add https://ui.tmih06.com/r/background-agents.jsonUsage
Pass your own data and wire the callbacks to your agent runtime.
import { BackgroundAgents, type BackgroundAgent } from "@/components/ui/background-agents";
export function AgentsPanel({ agents }: { agents: BackgroundAgent[] }) {
return (
<BackgroundAgents
data={agents}
onPause={(agent) => runtime.pause(agent.id)}
onResume={(agent) => runtime.resume(agent.id)}
onCancel={(agent) => runtime.cancel(agent.id)}
onOpen={(agent) => router.push(`/agents/${agent.id}`)}
onReview={(agent) => router.push(`/agents/${agent.id}/review`)}
/>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| data* | BackgroundAgent[] | — | Agents to show, in your order. Each tile or avatar fills from the bottom as progress grows. |
| layout | "grid" | "dock" | "grid" | Grid shows a live tile per agent; dock is a row of avatars that expands into the selected agent. |
| onPause / onResume / onCancel / onOpen | (agent: BackgroundAgent) => void | — | Each shows its action on the tile (on hover or focus) or in the dock strip. Update the agent's status yourself. |
| onReview | (agent: BackgroundAgent) => void | — | Called from the Review action of an agent with status waiting. Falls back to onOpen. |
| selectedId | string | null | — | Controls which agent the dock expands; null collapses it. |
| onSelect | (agent: BackgroundAgent | null) => void | — | Called when the viewer picks or collapses an agent in the dock. |
| labels | Partial<BackgroundAgentsLabels> | — | Your own UI strings: status names, Review and screen-reader text, for translating. Right-to-left works under `dir="rtl"`; the dock's level fills from the start edge. |
| className | string | — | Extra classes for the root section. |
type BackgroundAgent = {
id: string;
name: string;
task: string;
status: "queued" | "running" | "waiting" | "paused" | "done" | "failed" | "cancelled";
progress: number; // 0–1
action?: string; // what it is doing right now
elapsedMs: number;
};