All components (283)
Subagent
AI · Subagent
What it is and when to use it
An agent to which another has delegated a job: its name, its task, where it stands and, folded, what it has been doing and what it returned.
When to use it
- Showing the work an agent hands out: a security review, a parallel search.
statussays where it stands (in progress by default: it comes out open);resultis what it returns and the children are its log, normallyToolCall.
When not to
- A single tool call:
ToolCall. - The steps of a plan:
Plan. - The reasoning of a model:
Reasoning.
Keyboard: the title folds and opens: Tab, Enter or Space.
Accessibility: the state is seen through the icon and said with hidden text. While it works it carries aria-busy. The task and the result are a definition list.
Fine-tuning: amset-subagent and the amset-subagent__* classes; the line on the border changes with the state.
What it looks like
- Task
- Look for SQL injections in the order controllers.
<Subagent
name="Security reviewer"
task="Look for SQL injections in the order controllers."
status="active"
durationMs={6400}
toolCount={3}
/>Props
Import it with import { Subagent } from '@amset/ui'. Required props are marked.
| Prop | Type | What it does |
|---|---|---|
namerequired | string | What the agent is called: "Security reviewer". Required. |
taskrequired | string | What it has been asked to do. |
children | ReactNode | What it has been doing: its tool calls, its log. |
className | string | Merged with the library classes; it does not replace them. |
defaultExpanded | boolean | Open at the start. By default, only while it works. |
durationMs | number | How long it took, in milliseconds. |
result | ReactNode | What it returned when it finishes. |
status | "pending" | "done" | "active" | "failed" | "skipped" | Where it stands: pending, in progress, done, failed or skipped. In progress by default. |
toolCount | number | How many tools it has used: it is said in the header, next to the state. |
tools | readonly SubagentTool[] | The tools it has used, with how long each took. If given, `toolCount` comes from its length. |
It also accepts the attributes of the element it renders: className, style, data-*, aria-* and its events.
In the test bench
Every state and variant, to try one at a time, on its page at storybook.amsetui.com:
