ChatSubagentCardComponent
ChatSubagentCardComponent is a composition that renders an expandable card for a subagent stream. It displays the subagent's tool call ID, current status (with a color-coded badge), and expands to show the message count and latest message content.
Selector: chat-subagent-card
Import:
Basic Usage
API
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
subagent | Subagent | Required | The subagent to display |
Subagent
The Subagent type comes from @ngaf/chat. It provides reactive state for a subagent:
| Property | Type | Description |
|---|---|---|
toolCallId | string | The ID linking this subagent to its parent tool call |
status() | Signal<'pending' | 'running' | 'complete' | 'error'> | Current execution status |
messages() | Signal<Message[]> | Messages produced by the subagent |
Card Behavior
Collapsed State (Default)
The card header shows:
- An agent icon on the left
- "Subagent" label with the
toolCallIdin monospace - A color-coded status badge
- A chevron toggle on the right
Expanded State
Clicking the header toggles expansion. The expanded area shows:
- Message count (e.g., "3 message(s)")
- The content of the latest message (either as plain text or serialized JSON)
Status Badge Colors
The status badge uses different chat theme variables based on the current status:
| Status | Background | Text Color |
|---|---|---|
pending | --ngaf-chat-surface-alt | --ngaf-chat-text-muted |
running | --ngaf-chat-warning-bg | --ngaf-chat-warning-text |
complete | (none) | --ngaf-chat-success |
error | --ngaf-chat-error-bg | --ngaf-chat-error-text |
Using with ChatSubagentsComponent
The ChatSubagentsComponent primitive iterates over active subagent streams from an Agent. Combine it with ChatSubagentCardComponent:
Full Example
Styling
The card uses the following CSS custom properties:
| Variable | Applied To |
|---|---|
--ngaf-chat-surface-alt | Card background |
--ngaf-chat-surface | Latest message content background |
--ngaf-chat-separator | Card border, section dividers |
--ngaf-chat-radius-card | Card border radius |
--ngaf-chat-text | Subagent label, message content |
--ngaf-chat-text-muted | Agent icon, tool call ID, chevron, message count |
ARIA
- The header button has
aria-expandedreflecting the current state - The button has
aria-label="Toggle subagent details"