shadcn.io is an independent project built on shadcn/ui
A button that opens a menu of chat apps, each a link that starts a new chat with your query already typed in.
Use it where a reader may want to keep going with their own assistant: under a docs page, beside a search result, at the end of an answer. Pass the question once as query and every item builds its app's link from it, with the encoding done. In React, it's a Dropdown Menu of links that open in a new tab: nothing is sent until the reader picks an app, and the chat itself happens there, not on your page.
Installation
Anatomy

OpenIn
โโโ OpenInTrigger
โโโ OpenInContent
โโโ OpenInGroup
โ โโโ OpenInLabel
โ โโโ OpenInChatGPT
โ โโโ OpenInClaude
โ โโโ OpenInT3
โ โโโ OpenInScira
โโโ OpenInSeparator
โโโ OpenInv0
โโโ OpenInCursor
โโโ OpenInItem (one of your own)OpenInTrigger draws an Open in chat button when it has no child. useOpenInContext reads the query from inside OpenIn, for an item of your own.
Usage
import {
OpenIn, OpenInChatGPT, OpenInClaude, OpenInContent, OpenInCursor,
OpenInTrigger,
} from "@/components/ui/open-in-chat";<OpenIn query="How can I implement authentication in Next.js?">
<OpenInTrigger />
<OpenInContent>
<OpenInChatGPT />
<OpenInClaude />
<OpenInCursor />
</OpenInContent>
</OpenIn>Providers
Each item is a link to its app with the query in the URL, opened in a new tab with rel="noopener noreferrer", so the app can't reach back into your page or see where the reader came from.
| Part | Opens | Query in |
|---|---|---|
OpenInChatGPT | https://chatgpt.com/ with search on | prompt |
OpenInClaude | https://claude.ai/new | q |
OpenInT3 | https://t3.chat/new | q |
OpenInScira | https://scira.ai/ | q |
OpenInv0 | https://v0.app | q |
OpenInCursor | https://cursor.com/link/prompt | text |
label replaces an item's text, Open in and the app's name. Each app reads its own parameter, so if one stops prefilling, check its URL before the component.
Demos
Labels
The six apps in two groups, Chat and Code, each an OpenInGroup with an OpenInLabel on top and an OpenInSeparator between them. label shortens each item to the app's name, since the heading already says what the menu does. Use groups when the list mixes chat apps with tools that build code, so the reader finds theirs at a glance.
Custom
Two items of your own beside the built-in ones: OpenInItem as a link to Perplexity, its URL built from the same query, and a Copy prompt item that copies the query and stays open to say it did. Use OpenInItem for an app the component doesn't know, and keep its link opening in a new tab like the rest.
Trigger
An Ask AI button of your own under an answer, with the question it answers as the query. Give OpenInTrigger your button and the menu opens from it, lined up with its start. Use a small ghost button where the menu is a side path, and the default outline button where opening the chat is the point.
Migrating from AI SDK Elements
If you added Open in Chat from AI SDK Elements@/components/ai-elements/open-in-chat to @/components/ui/open-in-chat. Every part keeps its name and props, and each app's link is built the same way. What differs:
- The links open with
rel="noopener noreferrer", notnoopeneralone, so the apps don't see your page's address. OpenInSciratakes alabellike the others,OpenInGroupis new for labelled groups, anduseOpenInContextis exported for items of your own.- The menu opens lined up with the trigger's start, as
align="start"did.
On Ark UI, an OpenInItem of your own needs a value, and OpenIn takes the menu's positioning, bottom-start unless you set it.
FAQ
How do I install Open in Chat in React?
Run the command in the Installation section on this page. It adds open-in-chat to your ui folder with the Dropdown Menu and Button it's built from. The app marks are inline SVGs in the file, so there's no icon package beyond lucide.
The command uses the shadcn CLI.
Which apps can Open in Chat open?
ChatGPT, Claude, T3 Chat, Scira, v0 and Cursor, one part each, every one a link with the query in its URL. The Providers table lists each address and the parameter it reads. Use only the ones your readers have; an empty menu item is worse than a short menu.
How does Open in Chat pass the question to each app?
Set query on OpenIn: each item reads it and builds its link with URLSearchParams, so spaces, question marks and quotes arrive intact. Keep it to a question or a short prompt; a URL holds a few thousand characters, so link to a long page rather than pasting it.
How do I add another app to Open in Chat?
Add an OpenInItem with a link to it, as the Custom demo does for Perplexity: build its URL from the same query, and open it in a new tab with rel="noopener noreferrer". Inside OpenIn, useOpenInContext gives an item of your own the query.
Why does Open in Chat open a new tab?
So the reader keeps your page while the chat starts beside it. Each link has target="_blank" and rel="noopener noreferrer": the app gets the query and nothing else, neither a handle on your window nor the address it came from.
Can Open in Chat be used with the keyboard?
Yes. Enter, Space or the down arrow on the trigger opens the menu, and the arrow keys move through the apps. Enter opens the highlighted app in a new tab and closes the menu. Escape closes it without opening anything and puts focus back on the trigger.
Is this the same as AI SDK Elements' Open in Chat?
It has the same parts and props, so most code only changes its import. Links hide your page's address from the apps, Scira takes a label like the rest, and there's a group part for labelled groups. The Migrating section lists what differs on your stack.
API Reference
OpenIn
querystring
The text to open each chat with: a question, a prompt or a page.
OpenInTrigger
data-slot="open-in-trigger"
OpenInContent
data-slot="open-in-content"
className?string
Merged with the part's classes.
OpenInItem
data-slot="open-in-item"
OpenInGroup
data-slot="open-in-group"
OpenInLabel
data-slot="open-in-label"
OpenInSeparator
data-slot="open-in-separator"
OpenInChatGPT
label?string
The item's text, in place of Open in and the app's name.
value?string
The item's value in the menu.
- Default
chatgpt
className?string
Merged with the part's classes.
OpenInClaude
label?string
The item's text, in place of Open in and the app's name.
value?string
The item's value in the menu.
- Default
claude
className?string
Merged with the part's classes.
OpenInT3
label?string
The item's text, in place of Open in and the app's name.
value?string
The item's value in the menu.
- Default
t3
className?string
Merged with the part's classes.
OpenInScira
label?string
The item's text, in place of Open in and the app's name.
value?string
The item's value in the menu.
- Default
scira
className?string
Merged with the part's classes.
OpenInv0
label?string
The item's text, in place of Open in and the app's name.
value?string
The item's value in the menu.
- Default
v0
className?string
Merged with the part's classes.
OpenInCursor
label?string
The item's text, in place of Open in and the app's name.
value?string
The item's value in the menu.
- Default
cursor
className?string
Merged with the part's classes.













