# CopilotChat

> Inline chat component you can place anywhere and size as needed.

> **Not available for agent-spec yet.** The code on this page comes from the showcase's `agentic-chat` demo, and agent-spec doesn't have it yet. See this page for [CopilotKit's Built-in Agent](/prebuilt-components/chat), [LangGraph (Python)](/langgraph-python/prebuilt-components/chat), [LangGraph (TypeScript)](/langgraph-typescript/prebuilt-components/chat).

## What is this? [#what-is-this]

`<CopilotChat>` is the base prebuilt chat surface. Drop it in wherever you
want the chat to render and size it to fit your layout. `<CopilotSidebar>`
and `<CopilotPopup>` are both thin wrappers over the same primitives; if you
need a dedicated chat page or an inline pane alongside other content, this
is the component you want.

## When should I use this? [#when-should-i-use-this]

Use `<CopilotChat>` when you want:

- A full-bleed chat that fills its container
- An inline chat pane as part of a larger page
- A dedicated `/chat` route
- Maximum layout freedom (no docked chrome or launcher)

For a collapsible docked chat, use [CopilotSidebar](/agent-spec/prebuilt-components/sidebar).
For a floating bubble that overlays content, use [CopilotPopup](/agent-spec/prebuilt-components/popup).
For saved conversations and switching between prior conversations, drop in the [Threads Drawer](/agent-spec/prebuilt-components/copilot-threads-drawer) (or go headless with [Headless Threads](/agent-spec/headless-threads)).

## Basic setup [#basic-setup]

Wrap your app in `<CopilotKit>` once (the provider wires the runtime, session,
and agent registry) and render `<CopilotChat>` inside the layout of your
choosing:

```tsx
import { CopilotKit, CopilotChat } from "@copilotkit/react-core/v2";
import "@copilotkit/react-core/v2/styles.css";
```

Import from `@copilotkit/react-core/v2`. The `CopilotChat` in `@copilotkit/react-ui` is the [deprecated v1 chat](/agent-spec/migrate/v2).

## Code example [#code-example]

A component that renders the chat. `useAgenticChatSuggestions` is a demo hook that wraps `useConfigureSuggestions` to add starter suggestions:

## Common props [#common-props]

`<CopilotChat>` is the root primitive. `<CopilotSidebar>` and `<CopilotPopup>`
accept the same slots and labels, plus a few wrapper-specific props.

| Prop | Description |
|------|-------------|
| `agentId` | Agent slug the chat should talk to (must match an agent configured on the runtime). |
| `labels` | User-facing copy: header title, placeholder, welcome, disclaimer. |
| `messageView` | Slot for the message list. See [slots](/agent-spec/custom-look-and-feel/slots). |
| `input` | Slot for the composer area (text area, send button, disclaimer). |
| `scrollView` | Slot for the scroll container (e.g. custom feather/gradient). |
| `suggestionView` | Slot for the suggestion pills shown below messages. |
| `welcomeScreen` | Slot for the empty-state. Pass `false` to disable. |

## Styling [#styling]

`<CopilotChat>` is fully themable:

- **CSS variables / class overrides**: see [CSS customization](/agent-spec/custom-look-and-feel/css)
- **Slots (subcomponents)**: see [slots](/agent-spec/custom-look-and-feel/slots)
- **Fully headless**: see [headless UI](/agent-spec/custom-look-and-feel/headless-ui)
