`CopilotPopup` is a convenience wrapper for `CopilotChat` that lives at the same level as your main content in the view hierarchy. It provides **a floating chat interface** that can be toggled on and off. Popup Example ```tsx // [!code word:CopilotPopup] import { CopilotPopup } from "@copilotkit/react-ui"; export function YourApp() { return ( <> ); } ``` `CopilotSidebar` is a convenience wrapper for `CopilotChat` that wraps your main content in the view hierarchy. It provides a **collapsible and expandable sidebar** chat interface. Popup Example ```tsx // [!code word:CopilotSidebar] import { CopilotSidebar } from "@copilotkit/react-ui"; export function YourApp() { return ( ); } ``` `CopilotChat` is a flexible chat interface component that **can be placed anywhere in your app** and can be resized as you desire. Popup Example ```tsx // [!code word:CopilotChat] import { CopilotChat } from "@copilotkit/react-ui"; export function YourComponent() { return ( ); } ``` The built-in Copilot UI can be customized in many ways -- both through css and by passing in custom sub-components. CopilotKit also offers **fully custom headless UI**, through the `useCopilotChat` hook. Everything built with the built-in UI (and more) can be implemented with the headless UI, providing deep customizability. ```tsx import { useCopilotChat } from "@copilotkit/react-core"; import { Role, TextMessage } from "@copilotkit/runtime-client-gql"; export function CustomChatInterface() { const { visibleMessages, appendMessage, setMessages, deleteMessage, reloadMessages, stopGeneration, isLoading, } = useCopilotChat(); const sendMessage = (content: string) => { appendMessage(new TextMessage({ content, role: Role.User })); }; return (
{/* Implement your custom chat UI here */}
); } ```