Skip to content

shadcn.io is an independent project built on shadcn/ui

Components

Free

Open in Chat for Vue

A menu that opens your question in ChatGPT, Claude, Cursor or v0, each in a new tab. For Vue with Ark UI, with the query filled in for every app.

UI library: Ark 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 Vue, 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.

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.
Use email insteadNo credit card

Anatomy

Open in Chat anatomy: trigger, content, label, item, separator
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

<script setup lang="ts">
import {
  OpenIn, OpenInChatGPT, OpenInClaude, OpenInContent, OpenInCursor,
  OpenInTrigger,
} from "@/components/ui/open-in-chat";
</script>
<template>
  <OpenIn query="How can I implement authentication in Next.js?">
    <OpenInTrigger />
    <OpenInContent>
      <OpenInChatGPT />
      <OpenInClaude />
      <OpenInCursor />
    </OpenInContent>
  </OpenIn>
</template>

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.

PartOpensQuery in
OpenInChatGPThttps://chatgpt.com/ with search onprompt
OpenInClaudehttps://claude.ai/newq
OpenInT3https://t3.chat/newq
OpenInScirahttps://scira.ai/q
OpenInv0https://v0.appq
OpenInCursorhttps://cursor.com/link/prompttext

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.

Preview width

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.

Preview width

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.

Preview width

Migrating from AI SDK Elements

AI SDK Elements is for React. In Vue, Open in Chat has the same parts and props, and the demos above show them in Vue's syntax.

FAQ

How do I install Open in Chat in Vue?

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-vue 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

PropType
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"

PropType
class?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

PropType
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
class?string

Merged with the part's classes.

OpenInClaude

PropType
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
class?string

Merged with the part's classes.

OpenInT3

PropType
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
class?string

Merged with the part's classes.

OpenInScira

PropType
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
class?string

Merged with the part's classes.

OpenInv0

PropType
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
class?string

Merged with the part's classes.

OpenInCursor

PropType
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
class?string

Merged with the part's classes.