Open in chat
Hand the current prompt, page or answer to another assistant, with the prompt shown before it leaves.
On this page
A docs page offers to continue the question in the reader's own assistant.
Installation
Usage
import { OpenInChat } from "@/components/ui/chatcn/open-in-chat"
<OpenInChat query={`Read ${pageUrl} and explain how to rotate a signing secret.`} />The menu lists assistants that accept a prompt in their address (ChatGPT, Claude, Perplexity, T3 Chat and v0 by default), each opening a new tab with the prompt in place, plus Copy prompt for anything else. Assistants are listed by name: chatcn ships no third party logos, so pass your own marks through each provider's icon. The prompt is shown at the top of the menu, so nobody wonders what leaves the page. Replaces AI Elements' Open In Chat.
Examples
States
Ghost and subtle triggers, a short provider list, and disabled.
Props
| Prop | Type | Notes |
|---|---|---|
query | string | The prompt handed over |
providers | ChatProvider[] | { id, name, href(query), icon? }. Defaults to chatProviders |
variant, size, align | The trigger's look and the menu's side | |
onOpen, onCopy | ||
disabled | boolean | |
labels | Partial<OpenInChatLabels> | Every string, for translation |
Keyboard
| Key | Action |
|---|---|
| Enter or Space on the trigger | Open the menu |
| Arrow keys, Enter | Choose an assistant |
Accessibility
- Each assistant says it opens in a new tab.
- Copy prompt announces Copied politely.