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 |
open | boolean | false | Two-way bindable. Controls whether the sidebar is open |
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
Styling
Override the sidebar width using a CSS custom property:
See Theming for the full token reference.