showcase/shell-docs/src/content/reference/react-native/components/CopilotPopup.mdx
CopilotPopup renders a floating action button (FAB) that opens a chat in a modal overlay card with a header and a dismissible backdrop. Like CopilotSidebar, its chat area wraps a headless CopilotChat. Provide your chat UI as children, or drop in the prebuilt UI CopilotChat from @copilotkit/react-native/components.
Control it imperatively through a CopilotPopupHandle ref.
import { CopilotPopup, type CopilotPopupHandle } from "@copilotkit/react-native";
import { CopilotPopup, type CopilotPopupHandle } from "@copilotkit/react-native";
import { CopilotChat } from "@copilotkit/react-native/components";
import { useRef } from "react";
export function ChatScreen() {
const popupRef = useRef<CopilotPopupHandle>(null);
return (
<CopilotPopup ref={popupRef} agentId="default" headerTitle="Chat">
<CopilotChat agentName="default" showHeader={false} />
</CopilotPopup>
);
}
dismissOnBackdropPress is true.showToggleButton is true, a floating action button opens the popup and hides while it is open.height (e.g. "60%") resolves against the screen height; a number is used as points.CopilotSidebar: slide-in drawer variantCopilotChat: the chat primitive wrapped inside the popup