Open In Chat

The Open In Chat component provides a dropdown menu that allows users to open queries in different AI chat platforms with a single click.

Click the button below to open the query in various AI chat platforms:
Query: "How can I implement authentication in SvelteKit?"

Installation

pnpm dlx shadcn-svelte@latest add https://svelte-ai-elements.vercel.app/r/open-in-chat.json

If you prefer using jsrepo, please install via the command below:

pnpm dlx jsrepo add @ai/elements/ai-elements/open-in-chat

Usage

Props

OpenIn

PropTypeDefaultDescription
querystring-The query/prompt text to open in the selected chat provider
childrenSnippet-Child components (typically OpenInTrigger and OpenInContent)

OpenInTrigger

PropTypeDefaultDescription
classstring-Additional CSS classes to apply to the trigger
childrenSnippet-Custom trigger content (defaults to 'Open in chat' button)

OpenInContent

PropTypeDefaultDescription
classstring-Additional CSS classes to apply to the dropdown content
align'start' | 'center' | 'end''start'Alignment of the dropdown content
preventScrollbooleantrueWhether to prevent scrolling when the dropdown is open
childrenSnippet-Dropdown content (typically OpenInItem, OpenInLabel, OpenInSeparator)

OpenInItem

PropTypeDefaultDescription
classstring-Additional CSS classes to apply to the item
onclick() => void-Click handler for the item
childrenSnippet-Item content

OpenInLabel

PropTypeDefaultDescription
classstring-Additional CSS classes to apply to the label
childrenSnippet-Label content

OpenInSeparator

PropTypeDefaultDescription
classstring-Additional CSS classes to apply to the separator

OpenInChatGPT

PropTypeDefaultDescription
classstring-Additional CSS classes to apply to the ChatGPT menu item

OpenInClaude

PropTypeDefaultDescription
classstring-Additional CSS classes to apply to the Claude menu item

OpenInV0

PropTypeDefaultDescription
classstring-Additional CSS classes to apply to the V0 menu item

OpenInScira

PropTypeDefaultDescription
classstring-Additional CSS classes to apply to the Scira menu item

OpenInT3

PropTypeDefaultDescription
classstring-Additional CSS classes to apply to the T3 menu item