Agent activity Pro
What an AI agent is doing, step by step, as Claude, Cursor and Copilot show their agents' work: thinking, planning, searching, running tools and code, reading and editing files. Each step has a spinner and a soft shimmer while it runs, its time, and what it was given and returned folded under it. Steps can nest; a step that needs permission shows Approve and Deny; the run shows its state and time ("Working… 42s · 8 steps"), with Stop and Try again, and folds to that one line.
import { AgentActivity } from '@patine-ui/pro';
<AgentActivity steps={steps} task="Fix the flaky date test" onStop={() => setShown(script.length + 1)} onRetry={() => setShown(1)} style={{ width: 460 }} />
Try the props
variantstatusdesign<AgentActivity
steps={steps}
task="Fix the flaky date test"
onStop={stop}
/>
Example: an agent that asks first
A support agent working a refund: it reads the order and the policy on its own, then stops at the step that moves money and waits for a person. Approve finishes the run; Deny ends it with a note.
<View style={{ width: '100%', maxWidth: 480 }}> <AgentActivity steps={steps} task="Lena Novak wants a refund for order #20417" status={answer === 'waiting' ? 'running' : answer === 'approved' ? 'done' : 'error'} onApprove={() => setAnswer('approved')} onDeny={() => setAnswer('denied')} onRetry={() => setAnswer('waiting')} /> </View>
Steps
A step is { id, kind?, title, detail?, status, startedAt?, endedAt?, durationMs?, input?, output?, sources?, children? }. kind picks the icon: 'thinking', 'plan', 'search', 'browse', 'tool', 'code', 'file' or 'message'. status is 'pending', 'running', 'waiting' (for approval), 'done', 'error' or 'skipped'. Times come from startedAt and endedAt (a running step counts up each second) or durationMs. Steps with input, output or sources open to show them; expanded, defaultExpanded and onExpandedChange control which are open.
The run
status is the run's state, worked out from the steps unless you pass it: running, waiting, done, failed, stopped or idle. onStop shows Stop while it runs, onRetry shows Try again after a failure or a stop. The header folds the steps away into its summary: collapsed, defaultCollapsed and onCollapsedChange control it.
Approvals and nesting
A step 'waiting' for permission shows Approve and Deny when onApprove and onDeny are set; the card's border turns amber while it waits. children nest sub-steps under a step, as a sub-agent's work.
<View style={{ gap: 8, width: 460 }}> <AgentActivity steps={steps} title="Billing agent" onApprove={(s) => setLog(`Approved: ${s.title}`)} onDeny={(s) => setLog(`Denied: ${s.title}`)} /> <Text>{log}</Text> </View>
Variants
variant is 'card' (the default), 'timeline' (no card) or 'compact' (tight rows with small markers, for a chat bubble).
<AgentActivity steps={steps} variant="compact" onRetry={() => {}} style={{ width: 380 }} />
Accessibility
Each step is read with its status and time ("Searched the codebase, Done, 3.4s"), says whether it opens, and the run's summary is a polite live region, so screen readers hear progress without being interrupted. Spinners and the shimmer stop when the OS asks to reduce motion.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
steps | AgentStep[] | — | See Steps. |
status | 'running' | 'waiting' | 'done' | 'error' | 'stopped' | 'idle' | from the steps | |
title / task | string | 'Agent' | |
variant | 'card' | 'timeline' | 'compact' | 'card' | |
expanded / defaultExpanded / onExpandedChange | string[] | [] | Open steps. |
collapsed / defaultCollapsed / onCollapsedChange | boolean | false | |
onStop / onRetry | () => void | — | |
onApprove / onDeny | (step) => void | — | |
onSourcePress | (source) => void | opens its URL | |
showDurations | boolean | true | |
now | Date | a ticking clock | |
renderDetail | (info) => ReactNode | — | A step's open details. |
density / animate / labels / design / theme / style |