affectUI › Components › Agents

Tool Activity

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.

Part of affectUI Pro. Install: npx shadcn@latest add https://www.affectui.com/r/tool-activity.json · Import from @/components/ui/tool-activity

When to use

  • Which tools an agent reached for, day by day – and how busy it was – at a glance
  • A dashboard tile next to other agent chart cards, live as today's calls come in

When not to use

  • Which tools an agent may use at all – use Tool Access Map
  • One run's tool calls in order – use Tool Call Card or Trace Waterfall

Usage

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()} />

Props

NameTypeDefaultDescription
toolsActivityTool[]{ id, name, color? } – one row each, top to bottom; colors default to blue, pink, purple, cyan, orange, green, teal, amber
daysActivityDay[]{ label, counts } – oldest first, the last one is today; counts are per tool id, labels must be unique
unitstring"calls"What a count is
titlestring"Tool Activity"Heading on the frame
iconReactNodeA small mark before the title – defaults to a bolt, in orange
actionLabel / onActionstring / () => void"Open"The button on the top right – it shows when onAction is given
classNamestringExtra class on the root

Keyboard

  • Tab: Moves into the dots (one stop) and on to Open
  • ArrowLeft / ArrowRight / ArrowUp / ArrowDown: Walks the days and tools and shows each one's calls; Home and End jump to the first and the last day
  • Esc: Lets go of the dot

Accessibility

  • The dots are a single tab stop; the dot you're on is its description – tool, day and calls
  • The total, today's calls and how many days and tools it covers are plain text

Responsive

  • 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"

Requirements

  • React 19

Related

  • Latency Range – How fast an agent answers, hour by hour, like a blood-pressure chart – every hour as a bar from p50 to p95, pink above the target, the latest large and in blue
  • Run Transit – An agent carrying a job from one place to another like a flight on its way – where it comes from, where it goes, the time left and a bar its pixel mark rides on
  • Tool Access Map – An agent in the middle with every tool it can reach around it – which ones it used, which failed and which it calls right now; open a tool for its calls and replay one on its own
  • Agent Fleet – Several agents side by side – each card sums up its sub-agents, and a click opens its tree to the right while the last one folds back into its card