ChatSidebarComponent
ChatSidebarComponent is a composition that renders a slide-in chat panel anchored to the right edge of the screen. Unlike a popup window, the sidebar can optionally push your app content aside rather than overlaying it, keeping both the chat and your UI visible at the same time.
Selector: chat-sidebar
Import:
#When to Use It
Use ChatSidebarComponent when you want the chat to be accessible without completely obscuring the underlying application. It works well for copilot-style experiences where the user references the app while talking to the assistant.
If you need a floating overlay that does not affect layout, use <chat-popup>. If you need the chat to always fill its container, use <chat>.
#Basic Usage
#Push-Content Mode
When pushContent is true, the sidebar shifts the projected <ng-content> to the left rather than overlaying it. This keeps your application content fully visible alongside the chat panel.
In push-content mode, ChatSidebarComponent uses display: flex on its host. The projected content should be designed to reflow gracefully when its available width is reduced.
#API
#Inputs
| Input | Type | Default | Description |
|---|---|---|---|
agent | Agent | Required | The agent providing streaming state |
views | ViewRegistry | undefined | undefined | A2UI/json-render component registry forwarded to the inner <chat> |
clientTools | ClientToolRegistry | undefined | undefined | Frontend-declared client tools forwarded to the inner <chat> |
modelOptions | readonly ChatSelectOption[] | [] | Options for the chat input model picker |
showModelPicker | boolean | true | Hides the model picker when false, even when modelOptions is non-empty |
selectedModel | string (two-way) | '' | Current selected model value |
open | boolean (two-way) | false | Two-way bindable. Controls whether the sidebar is open |
closeOnEscape | boolean | true | Closes the sidebar when Escape is pressed |
pushContent | boolean | false | When true, the sidebar shifts projected content rather than overlaying it |
#Outputs
| Output | Type | Description |
|---|---|---|
openChange | boolean | Emits when the sidebar opens or closes. Use with [(open)] for two-way binding |
#Slots
| Slot | Selector | Description |
|---|---|---|
| App content | (default) | Projected via <ng-content>. Rendered alongside or behind the chat panel |
| Header content | [chatHeader] | Projected into the sidebar header bar. Replaces the default title |
#Methods
| Method | Description |
|---|---|
toggle() | Toggles the sidebar between open and closed |
openWindow() | Opens the sidebar |
closeWindow() | Closes the sidebar |
#Controlled Open State
#A2UI and Client Tools
ChatSidebarComponent forwards views and clientTools to the inner <chat>. Use these inputs when the sidebar should render A2UI surfaces or expose browser-declared tools to the agent:
#Styling
Override the sidebar width using a CSS custom property:
See Theming for the full token reference.