Loading component…
Loading component…
Which tools an agent used, day by day, as a field of dots – each lights up in its tool's color, the stronger the busier, with today's calls and the total on top
To reuse this local React demo, copy all files from the Code tab into the same folder, then import ToolActivity from ./tool-activity.
import { ToolActivity, type ActivityTool, type ActivityDay } from "@/components/ui/tool-activity";
const tools: ActivityTool[] = [
{ id: "search", name: "Web search" },
{ id: "code", name: "Code runner" },
{ id: "db", name: "Database" },
];
const days: ActivityDay[] = stats.map((s) => ({
label: s.day, // "14"
counts: { search: s.search, code: s.code, db: s.db },
}));
<ToolActivity title="Research agent activity" tools={tools} days={days} onAction={() => openAgent()} />| Name | Type | Default | Description |
|---|---|---|---|
| tools | ActivityTool[] | { id, name, color? } – one row each, top to bottom; colors default to blue, pink, purple, cyan, orange, green, teal, amber | |
| days | ActivityDay[] | { label, counts } – oldest first, the last one is today; counts are per tool id, labels must be unique | |
| unit | string | "calls" | What a count is |
| title | string | "Tool Activity" | Heading on the frame |
| icon | ReactNode | A small mark before the title – defaults to a bolt, in orange | |
| actionLabel / onAction | string / () => void | "Open" | The button on the top right – it shows when onAction is given |
| className | string | Extra class on the root |
Built on a container query; under 400px the two columns get tighter and the dots smaller – the card keeps the same size as every agent chart card
The oldest days fade out at the left edge; every other day is labelled
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"