showcase/shell-docs/src/content/reference/angular/components/CopilotChatView.mdx
CopilotChatView is the layout-only chat view. It renders the message feed, the input container, the feather effect, the disclaimer, the suggestion pills, and a welcome screen when there are no messages. It does not wire an agent on its own. You pass it messages and read interaction handlers from the surrounding ChatState.
This is the Angular equivalent of React's <CopilotChatView>. Contrast it with CopilotChat: CopilotChat wires the agent (resolving messages, running state, suggestions, and submission) and renders CopilotChatView underneath, while CopilotChatView is presentational. Use it directly when you manage messages and handlers yourself, or when you need deep control over the layout and its slots.
Almost every visual piece is a slot. Each slot accepts either a component class (*Component) or an Angular template (*Template), plus an optional class string (*Class).
CopilotChatView is a standalone component with the selector copilot-chat-view. Import the class into your component's imports array and use the element in the template.
import { Component, signal } from "@angular/core";
import { CopilotChatView } from "@copilotkit/angular";
import type { Message } from "@ag-ui/client";
@Component({
selector: "app-chat",
standalone: true,
imports: [CopilotChatView],
template: `
<copilot-chat-view [messages]="messages()" [autoScroll]="true" />
`,
})
export class ChatComponent {
messages = signal<Message[]>([]);
}
Each visual region exposes a component override, a template override, and a class. The template takes precedence over the component when both are set.
<PropertyReference name="messageViewComponent" type="Type<any>"> Component class to render the message list. Pair with `messageViewClass` to style it, or use `messageViewTemplate` for a template. </PropertyReference> <PropertyReference name="messageViewTemplate" type="TemplateRef<any>"> Template to render the message list. </PropertyReference> <PropertyReference name="messageViewClass" type="string"> Class applied to the message list. </PropertyReference> <PropertyReference name="scrollViewComponent" type="Type<any>"> Component class for the scrolling container around the message list. </PropertyReference> <PropertyReference name="scrollViewTemplate" type="TemplateRef<any>"> Template for the scrolling container. </PropertyReference> <PropertyReference name="scrollViewClass" type="string"> Class applied to the scrolling container. </PropertyReference> <PropertyReference name="scrollToBottomButtonComponent" type="Type<any>"> Component class for the scroll-to-bottom button. </PropertyReference> <PropertyReference name="scrollToBottomButtonTemplate" type="TemplateRef<any>"> Template for the scroll-to-bottom button. </PropertyReference> <PropertyReference name="scrollToBottomButtonClass" type="string"> Class applied to the scroll-to-bottom button. </PropertyReference> <PropertyReference name="inputComponent" type="Type<any>"> Component class for the chat input. Defaults to [`CopilotChatInput`](/reference/angular/components/CopilotChatInput). </PropertyReference> <PropertyReference name="inputTemplate" type="TemplateRef<any>"> Template for the chat input. </PropertyReference> <PropertyReference name="inputContainerComponent" type="Type<any>"> Component class for the container that wraps the input and disclaimer. </PropertyReference> <PropertyReference name="inputContainerTemplate" type="TemplateRef<any>"> Template for the input container. </PropertyReference> <PropertyReference name="inputContainerClass" type="string"> Class applied to the input container. </PropertyReference> <PropertyReference name="featherComponent" type="Type<any>"> Component class for the feather (fade) effect above the input. </PropertyReference> <PropertyReference name="featherTemplate" type="TemplateRef<any>"> Template for the feather effect. </PropertyReference> <PropertyReference name="featherClass" type="string"> Class applied to the feather effect. </PropertyReference> <PropertyReference name="disclaimerComponent" type="Type<any>"> Component class for the disclaimer shown beneath the input. </PropertyReference> <PropertyReference name="disclaimerTemplate" type="TemplateRef<any>"> Template for the disclaimer. </PropertyReference> <PropertyReference name="disclaimerClass" type="string"> Class applied to the disclaimer. </PropertyReference> <PropertyReference name="disclaimerText" type="string"> Text content for the disclaimer. </PropertyReference>CopilotChatView bubbles message-level interaction events from the message feed. Each payload is an object with the relevant message.
Beyond the slot inputs, CopilotChatView reads named templates from content projection (via @ContentChild) for deep customization. Provide them as <ng-template> elements with the matching reference variable inside <copilot-chat-view>.
import { Component, signal } from "@angular/core";
import { CopilotChatView } from "@copilotkit/angular";
import type { Message } from "@ag-ui/client";
@Component({
selector: "app-chat",
standalone: true,
imports: [CopilotChatView],
template: `
<copilot-chat-view [messages]="messages()">
<ng-template #customLayout let-ctx>
<div class="my-layout">
<ng-container [ngTemplateOutlet]="ctx.messageView" />
<ng-container [ngTemplateOutlet]="ctx.input" />
</div>
</ng-template>
</copilot-chat-view>
`,
})
export class ChatComponent {
messages = signal<Message[]>([]);
}