| title | <CopilotPopup /> |
|---|---|
| description | A chatbot popup component for CopilotKit. |
A chatbot popup component for the CopilotKit framework. The component allows for a high degree of customization through various props and custom CSS.
See CopilotSidebar for a sidebar version of this component.
```jsx CopilotPopup Example import { CopilotPopup } from "@copilotkit/react-ui";<CopilotPopup labels={{ title: "Your Assistant", initial: "Hi! 👋 How can I assist you today?", }} />
</RequestExample>
## Custom CSS
You can customize the colors of the chat window by overriding the CSS variables
defined in the [default styles](https://github.com/CopilotKit/CopilotKit/blob/main/CopilotKit/packages/react-ui/src/css/colors.css).
For example, to set the primary color to purple:
```jsx
<div style={{ "--copilot-kit-primary-color": "#7D5BA6" }}>
<CopilotPopup />
</div>
To further customize the chat window, you can override the CSS classes defined here.
For example:
.copilotKitButton {
border-radius: 0;
}<ResponseField name="initial" type="string | string[]">
The initial message(s) to display in the chat window.
</ResponseField>
<ResponseField name="title" type="string" default="CopilotKit">
The title to display in the header.
</ResponseField>
<ResponseField name="placeholder" type="string" default="Type a message...">
The placeholder to display in the input.
</ResponseField>
<ResponseField name="thinking" type="string" default="Thinking...">
The message to display while the assistant is "thinking".
</ResponseField>
<ResponseField name="error" type="string" default="❌ An error occurred. Please try again.">
The message to display when an error occurs.
</ResponseField>
<ResponseField name="stopGenerating" type="string" default="Stop generating">
The label to display on the stop button.
</ResponseField>
<ResponseField name="regenerateResponse" type="string" default="Regenerate response">
The label to display on the regenerate button.
</ResponseField>
<ResponseField name="ResponseButton" type="React.ComponentType"
A custom ResponseButton component to use instead of the default.
