AI Interface Components

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.en

New project or installation trouble? Start here →

Playground

Tune the props live — the code snippet updates as you go, so you can dial in the look you want before copying it.

0.4
200
120
Active edited usageDefault props
<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.json

Or, 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

PropTypeDefaultDescription
namestring—Subagent name, e.g. "Researcher"
taskstring—The task assigned to the subagent (one sentence)
status"queued" | "running" | "done" | "failed"—Current status
progressnumber—Progress (0–1); when omitted while running, the bar becomes an indeterminate sweep
currentStepstring—Current step; cross-fades when it changes
outputReact.ReactNode—The subagent's output; strings keep their line breaks
monobooleanfalseRender string output in a monospace font
summarystring—One-line summary shown once done
elapsednumber—Seconds elapsed, shown as "12s elapsed"
tokensnumber—Tokens used, shown in compact form (e.g. 1.2k tokens)
expandedboolean—Controlled expanded state
defaultExpandedboolean—Initial expanded state when uncontrolled; when omitted it follows status (failed expands, others collapse)
onExpandedChange(expanded: boolean) => void—Called when the expanded state changes
depthnumber1Nesting level; each level indents 16px and draws a connector
iconReact.ReactNode—Custom icon before the name (e.g. a subagent avatar)
stiffnessnumber120Progress bar spring stiffness
dampingnumber20Progress bar spring damping
durationnumber200Duration of the expand animation and colour transitions (ms)
classNamestring—Passed through to the outermost container

SubagentStatusCard.Group

FieldTypeDefaultDescription
childrenReact.ReactNode—Subagent cards (usually several SubagentStatusCard)
staggernumber60Delay between each card's entrance (ms)
aria-labelstring"Subagents"Accessible name for the group
classNamestring—Passed through to the outermost container

How it works

  • The progress bar advances with a scaleX spring tuned by stiffness / damping; it always fills when status is done and empties when queued.
  • Indeterminate state: when running with no progress, 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 to failed expands 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 depth level indents 16px; SubagentStatusCard.Group draws 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 an aria-label describing its state, e.g. "Subagent: Researcher, running, 40% complete"
  • When there is output, the header is a button with aria-expanded and aria-controls pointing 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" with aria-valuenow; in the indeterminate state the value is omitted and aria-valuetext says it is in progress
  • Status changes are announced through an aria-live="polite" region; connector lines and decorative icons are aria-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