Loading component…
Loading component…
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
To reuse this local React demo, copy all files from the Code tab into the same folder, then import AgentTimeSplit from ./agent-time-split.
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()}
/>| Name | Type | Default | Description |
|---|---|---|---|
| slices | TimeSlice[] | { id, label, ms, color? } – in the order they read; colors default to blue, purple, pink, amber, then gray | |
| live | boolean | The agent is at work right now – the last tick of the first part shimmers | |
| ticks | number | 60 | How many ticks the strip has (12–160); every part with time gets one at least |
| title | string | "Agent Time Split" | Heading on the frame |
| icon | ReactNode | A small mark before the title – defaults to a stopwatch, in purple | |
| actionLabel / onAction | string / () => void | "Open" | The button on the top right – it shows when onAction is given |
| formatDuration | (ms: number) => string | "38h 48m" | Formats every time |
| className | string | Extra class on the root |
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"