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.
CopilotChat wires the agent, messages, running state, suggestions, and submission, then renders CopilotChatView. Use CopilotChatView directly when you manage those values and handlers, or when you need full control over the layout and its slots.
The active slot inputs accept a component class (*Component) or an Angular template (*Template). The template takes precedence when both are set.
CopilotChatView is a standalone component with the selector copilot-chat-view. Its default input needs a ChatState provider. The example below supplies one.
import { Component, forwardRef, signal } from "@angular/core";
import { ChatState, CopilotChatView } from "@copilotkit/angular";
import type { Message } from "@ag-ui/client";
@Component({
selector: "app-chat",
standalone: true,
imports: [CopilotChatView],
providers: [
{
provide: ChatState,
useExisting: forwardRef(() => ChatComponent),
},
],
template: `
<copilot-chat-view [messages]="messages()" [autoScroll]="true" />
`,
})
export class ChatComponent extends ChatState {
readonly messages = signal<Message[]>([]);
readonly inputValue = signal("");
submitInput(value: string) {
// Send the message through your chat state owner.
}
changeInput(value: string) {
this.inputValue.set(value);
}
}
The view forwards message, input, scroll-button, input-container, feather, and disclaimer slots.
<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> <Callout type="warn"> The current release declares `scrollViewComponent`, `scrollViewTemplate`, and `scrollViewClass`, but the default layout always uses its built-in scroll view. Use `customLayout` when you need to replace it. </Callout> <PropertyReference name="assistantMessageComponent" type="Type<any>"> Component class used for assistant messages. </PropertyReference> <PropertyReference name="assistantMessageTemplate" type="TemplateRef<any>"> Template used for assistant messages. Takes precedence over `assistantMessageComponent`. </PropertyReference> <PropertyReference name="assistantMessageClass" type="string"> CSS classes forwarded to assistant messages. </PropertyReference> <PropertyReference name="reasoningMessageComponent" type="Type<any>"> Component class used for reasoning messages. </PropertyReference> <PropertyReference name="reasoningMessageTemplate" type="TemplateRef<any>"> Template used for reasoning messages. Takes precedence over `reasoningMessageComponent`. </PropertyReference> <PropertyReference name="reasoningMessageClass" type="string"> CSS classes forwarded to reasoning messages. </PropertyReference> <PropertyReference name="messageViewChildrenComponent" type="Type<any>"> Component rendered after the message list and before the cursor. </PropertyReference> <PropertyReference name="messageViewChildrenTemplate" type="TemplateRef<any>"> Template rendered after the message list. Takes precedence over `messageViewChildrenComponent`. </PropertyReference> <PropertyReference name="messageViewChildrenClass" type="string"> CSS classes forwarded to the message-list children slot. </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> <Callout type="warn"> `featherClass` is declared but the current release does not pass its string value to the feather slot. Use a feather component or template to style that region. </Callout> <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 assistant-message actions from the message feed. Each payload is an object with the relevant message.
CopilotChatView supports one active projected template named customLayout.
import { Component, forwardRef, signal } from "@angular/core";
import {
ChatState,
CopilotChatInput,
CopilotChatMessageView,
CopilotChatView,
} from "@copilotkit/angular";
import type { Message } from "@ag-ui/client";
@Component({
selector: "app-chat",
standalone: true,
imports: [CopilotChatInput, CopilotChatMessageView, CopilotChatView],
providers: [
{
provide: ChatState,
useExisting: forwardRef(() => ChatComponent),
},
],
template: `
<copilot-chat-view [messages]="messages()">
<ng-template #customLayout>
<div class="my-layout">
<copilot-chat-message-view [messages]="messages()" />
<copilot-chat-input />
</div>
</ng-template>
</copilot-chat-view>
`,
})
export class ChatComponent extends ChatState {
readonly messages = signal<Message[]>([]);
readonly inputValue = signal("");
submitInput(value: string) {
// Send the message through your chat state owner.
}
changeInput(value: string) {
this.inputValue.set(value);
}
}