Subagent Status Card
A React subagent status card nested under its parent message, showing the task, a progress bar and current step, expandable to reveal its streamed output and collapsing to a one-line summary when done; a Group shares one connector line and staggers the cards in.
When a main agent fans work out to several subagents, this card lists each one's status indented beneath the main message. The header row holds the status icon, name, task and elapsed time / token count; below it sits a 2px progress bar (an indeterminate sweep when no progress is given) and the current step, which cross-fades as it changes. Click the header to expand the subagent's streamed output, which scrolls within a max height and sticks to the bottom while you are there; once done with a summary, the progress bar fades out and a one-line summary takes its place. Wrap cards in SubagentStatusCard.Group to share one connector line on the left and stagger them in.
Bring this into your project
Run this command in your project folder. The CLI adds the source and dependencies; then follow the usage example below.
npx webberui@latest add subagent-status-card.enPlayground
Tune the props live — the code snippet updates as you go, so you can dial in the look you want before copying it.
<SubagentStatusCard/>
The complete example includes the preview layout and data. Install the component first, then paste this file into your project.
Installation
npx webberui@latest add https://webberui.com/r/subagent-status-card.en.jsonOr, once registries are configured in components.json, install it as @webberui/subagent-status-card.
Usage
import { SubagentStatusCard } from "@/components/ui/subagent-status-card";
<SubagentStatusCard.Group aria-label="Market research subagents">
<SubagentStatusCard
name="Researcher"
task="Search the past year of bubble tea market coverage"
status="running"
progress={0.4}
currentStep="Reading document 3"
output={"- Store openings slowed\n- Growth shifted south"}
elapsed={12}
tokens={1240}
/>
<SubagentStatusCard
name="Writer"
task="Produce an 800-word summary"
status="done"
summary="Wrote an 812-word summary with 3 key points"
/>
</SubagentStatusCard.Group>Props
| Prop | Type | Default | Description |
|---|---|---|---|
name | string | — | Subagent name, e.g. "Researcher" |
task | string | — | The task assigned to the subagent (one sentence) |
status | "queued" | "running" | "done" | "failed" | — | Current status |
progress | number | — | Progress (0–1); when omitted while running, the bar becomes an indeterminate sweep |
currentStep | string | — | Current step; cross-fades when it changes |
output | React.ReactNode | — | The subagent's output; strings keep their line breaks |
mono | boolean | false | Render string output in a monospace font |
summary | string | — | One-line summary shown once done |
elapsed | number | — | Seconds elapsed, shown as "12s elapsed" |
tokens | number | — | Tokens used, shown in compact form (e.g. 1.2k tokens) |
expanded | boolean | — | Controlled expanded state |
defaultExpanded | boolean | — | Initial expanded state when uncontrolled; when omitted it follows status (failed expands, others collapse) |
onExpandedChange | (expanded: boolean) => void | — | Called when the expanded state changes |
depth | number | 1 | Nesting level; each level indents 16px and draws a connector |
icon | React.ReactNode | — | Custom icon before the name (e.g. a subagent avatar) |
stiffness | number | 120 | Progress bar spring stiffness |
damping | number | 20 | Progress bar spring damping |
duration | number | 200 | Duration of the expand animation and colour transitions (ms) |
className | string | — | Passed through to the outermost container |
SubagentStatusCard.Group
| Field | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | — | Subagent cards (usually several SubagentStatusCard) |
stagger | number | 60 | Delay between each card's entrance (ms) |
aria-label | string | "Subagents" | Accessible name for the group |
className | string | — | Passed through to the outermost container |
How it works
- The progress bar advances with a
scaleXspring tuned bystiffness/damping; it always fills whenstatusisdoneand empties whenqueued. - Indeterminate state: when
runningwith noprogress, a 40%-wide highlight sweeps back and forth every 1.4 seconds. - The output area caps at 240px and scrolls internally; while you sit at the bottom new content sticks to it, and scrolling up to read is never yanked back.
- When uncontrolled and the user has not toggled yet, the expanded state follows
status— switching tofailedexpands automatically so the error is visible at a glance. - The root sets
--wb-subagent-status-card-duration, used by the colour and chevron transitions, so you can override it globally. - Each
depthlevel indents 16px;SubagentStatusCard.Groupdraws one shared trunk line on the left, each card joins it with a short tick, and cards enter 60ms apart (opacity and x offset).
Accessibility
- Each card is
role="group"with anaria-labeldescribing its state, e.g. "Subagent: Researcher, running, 40% complete" - When there is output, the header is a
buttonwitharia-expandedandaria-controlspointing at the output region; it is reachable with Tab, toggles with Enter / Space, and shows a focus-visible ring - The progress bar is
role="progressbar"witharia-valuenow; in the indeterminate state the value is omitted andaria-valuetextsays it is in progress - Status changes are announced through an
aria-live="polite"region; connector lines and decorative icons arearia-hidden - When the user has enabled reduce motion, the progress bar jumps into place, the indeterminate sweep becomes a static bar, the status icon does not pop, the output appears instantly, and the Group does not stagger
Stack Trace Viewer
A stack trace viewer that lists each frame, highlights your own code while folding library frames, expands a frame into its source snippet, and copies the trace in one click.
Follow-up Suggestion Chips
A React component for AI suggested follow-ups: chips stagger in under a reply, and the clicked chip arcs into the input and becomes its text while the rest fold away. Supports wrapping or a single scrolling row, arrow-key navigation and IME-safe keys.