ChatInterruptPanelComponent
ChatInterruptPanelComponent is a composition that renders a styled interrupt card when the LangGraph agent pauses for human input. It displays the interrupt payload and provides action buttons for the user to accept, edit, respond to, or ignore the interrupt.
Selector: chat-interrupt-panel
Import:
How It Works
LangGraph agents can pause execution using interrupts -- checkpoints where the agent waits for human input before proceeding. The ChatInterruptPanelComponent reads the interrupt state from an Agent and renders a warning card with action buttons.
When no interrupt is active, the component renders nothing.
Basic Usage
API
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
agent | Agent | Required | The agent providing interrupt state |
Outputs
| Output | Type | Description |
|---|---|---|
action | InterruptAction | Emits when the user clicks an action button |
InterruptAction Type
| Action | Button Label | Typical Use |
|---|---|---|
'accept' | Accept | Approve the agent's proposed action and resume execution |
'edit' | Edit | Open an editor to modify the agent's proposal before resuming |
'respond' | Respond | Send a text response back to the agent |
'ignore' | Ignore | Dismiss the interrupt without taking action |
Interrupt Payload Display
The component extracts the interrupt payload and displays it as text:
- If the interrupt value is a
string, it is displayed directly - If the interrupt value is an object, it is serialized with
JSON.stringify()
Styling
The panel uses the chat theme's warning variables:
| Variable | Applied To |
|---|---|
--ngaf-chat-warning-bg | Panel background |
--ngaf-chat-warning-text | Header and message text |
--ngaf-chat-separator | Panel border |
--ngaf-chat-radius-card | Panel border radius |
--ngaf-chat-surface-alt | Action button backgrounds |
--ngaf-chat-text | Action button text |
--ngaf-chat-text-muted | Ignore button text |
Primitive Alternative: ChatInterruptComponent
If you need full control over the interrupt UI, use the lower-level ChatInterruptComponent primitive instead. It provides content projection via an ng-template:
The primitive also exports a getInterrupt() helper function: