Loading component…
Loading component…
Prompt composer with model picker, voice input, app connections and approval request
To reuse this local React demo, copy all files from the Code tab into the same folder, then import ChatComposer from ./chat-composer.
import { ChatComposer } from "@/components/ui/chat-composer";
export function Assistant() {
return <ChatComposer onSend={(message) => console.log(message)} />;
}| Name | Type | Default | Description |
|---|---|---|---|
| placeholder | string | "Start by typing..." | Placeholder of the message field |
| models | ChatModel[] | defaultModels | Entries of the model picker (Auto, Claude, ChatGPT); the first is selected |
| loadMs | number | 1300 | Duration of the “Request approval” loading state |
| dictation | string | "Draft a short update…" | Demo transcript that appears word by word in gray while recording – replace with real speech-to-text |
| onSend | (message: string, details: { model: string }) => void | Called on send or Enter | |
| onModelChange | (model: ChatModel) => void | Called when a model is picked | |
| onAttach | () => void | Called when the plus button is clicked – open your own picker here | |
| onRequestApproval | () => void | Called when “Request approval” is clicked | |
| folders | string[] | defaultFolders | Folders in the “Work in a folder” picker at the bottom left; an empty list leaves it out |
| folder | string | The folder to start in – the row shows its name instead of “Work in a folder” | |
| onFolderChange | (folder: string \| null) => void | Called when a folder is picked; null when the picked folder is picked again to leave it | |
| apps | ChatApp[] | defaultApps | Apps in the “Connect apps” menu at the bottom right (Gmail, Slack, ClickUp) – id, name and logo; the first three show their marks in the row |
| connectedApps | string[] | ["gmail"] | Ids of the apps that are connected to start with |
| onAppsChange | (connected: string[]) => void | Called when an app is connected or disconnected, with the ids of all connected apps |
Fills its container up to 680px wide; all sizes follow the width via container query units and stop growing at a compact maximum
In the last row the folder's name shortens first, so “Connect apps” and its marks always keep their place on the right
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"