affectUI › Components › Agents

Agent Time Split

Where an agent's time went – working, tool calls, waiting on you and idle – as a strip of thin ticks under the total, with every part's time and share below.

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

When to use

  • Where an agent's time went over a day or a week – working, waiting on you, idle – and how much it waited on people
  • A dashboard tile next to other agent chart cards

When not to use

  • How long each agent of a run took for its part – use Agent Timing
  • Where the time of one run goes, step by step – use Trace Waterfall

Usage

import { AgentTimeSplit } from "@/components/ui/agent-time-split";

<AgentTimeSplit
  title="Support agent this week"
  live
  slices={[
    { id: "work", label: "Working", ms: stats.workingMs },
    { id: "wait", label: "Waiting on you", ms: stats.waitingMs },
    { id: "idle", label: "Idle", ms: stats.idleMs },
  ]}
  onAction={() => openAgent()}
/>

Props

NameTypeDefaultDescription
slicesTimeSlice[]{ id, label, ms, color? } – in the order they read; colors default to blue, purple, pink, amber, then gray
livebooleanThe agent is at work right now – the last tick of the first part shimmers
ticksnumber60How many ticks the strip has (12–160); every part with time gets one at least
titlestring"Agent Time Split"Heading on the frame
iconReactNodeA small mark before the title – defaults to a stopwatch, in purple
actionLabel / onActionstring / () => void"Open"The button on the top right – it shows when onAction is given
formatDuration(ms: number) => string"38h 48m"Formats every time
classNamestringExtra class on the root

Keyboard

  • Tab: Moves through the parts – each one keeps its ticks while the rest steps back – and on to Open

Accessibility

  • Every part is a stop that reads its name, time and share; the strip itself is decoration
  • Shares always add up to the strip, so no part is lost to rounding

Responsive

  • Built on a container query; under 420px the legend steps aside and every part says its name – the card keeps the same size as every agent chart card
  • Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"

Requirements

  • React 19

Related

  • 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
  • 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
  • Agent Timing – An agent run as a timing diagram – a signal line per agent that steps up when it thinks or calls a tool, with hand-offs drawn straight between rows