value | string | — | Controlled text value. |
|---|
defaultValue | string | '' | Uncontrolled initial text value. |
|---|
onValueChange | (value: string) => void | — | Fired whenever the prompt text changes. |
|---|
onSubmit | (payload: ChatComposerSubmitPayload) => void | — | Fired when the user submits via Enter or the send button. |
|---|
onStop | () => void | — | Fired when the user clicks Stop during `'streaming'` status. |
|---|
status | ChatComposerStatus | 'ready' | Current submission / streaming lifecycle state. Defaults to `'ready'`. |
|---|
placeholder | string | — | Placeholder copy inside the auto-growing textarea. |
|---|
disabled | boolean | false | Disables typing, attachments, and submission. |
|---|
autoFocus | boolean | false | Auto-focus the textarea on mount. |
|---|
maxHeight | number | 200 | Maximum textarea height in pixels before scrolling. Defaults to `200`. |
|---|
models | readonly ChatComposerModel[] | DEFAULT_CHAT_MODELS | Available models shown in the bottom-left model picker. Pass `[]` to hide. |
|---|
model | string | — | Controlled selected model id. |
|---|
defaultModel | string | — | Uncontrolled initial model id. |
|---|
onModelChange | (modelId: string) => void | — | Fired when the user selects a different model. |
|---|
approvalModes | readonly ChatComposerApprovalMode[] | — | Optional human-in-the-loop approval modes (e.g. Always ask / Approve edits / Full access). |
|---|
approvalMode | string | — | Controlled selected approval mode id. |
|---|
defaultApprovalMode | string | — | Uncontrolled initial approval mode id. |
|---|
onApprovalModeChange | (modeId: string) => void | — | Fired when the user switches approval mode. |
|---|
attachments | readonly ChatComposerAttachment[] | — | Controlled attachment list. |
|---|
defaultAttachments | readonly ChatComposerAttachment[] | [] | Uncontrolled initial attachments. |
|---|
onAttachmentsChange | (attachments: ChatComposerAttachment[]) => void | — | Fired whenever attachments are added or removed. |
|---|
allowAttachments | boolean | true | Enables file attach button, paste, and drag-and-drop. Defaults to `true`. |
|---|
accept | string | — | Accepted MIME types / extensions for the file picker, paste, and drop. |
|---|
maxAttachments | number | 8 | Maximum number of attached files. Defaults to `8`. |
|---|
voice | boolean | true | Shows the voice dictation trigger with animated waveform feedback. Defaults to `true`. |
|---|
onVoiceChange | (listening: boolean) => void | — | Optional custom handler when toggling voice input; if omitted, uses Web Speech API with graceful fallback. |
|---|
suggestions | readonly ChatComposerSuggestion[] | — | Optional starter prompt chips displayed beneath the composer card. |
|---|
submitOnSuggestion | boolean | false | If `true`, clicking a suggestion submits immediately instead of filling the textarea. Defaults to `false`. |
|---|
commands | readonly ChatComposerCommand[] | — | Optional `/` slash commands surfaced in a floating menu when typing `/` in the prompt. |
|---|
onCommand | (command: ChatComposerCommand) => void | — | Fired when the user selects a `/` slash command. |
|---|
actions | readonly ChatComposerAction[] | — | Optional quick actions rendered in a `+` dropdown menu alongside file upload. |
|---|
onAction | (actionValue: string) => void | — | Fired when the user picks an item from the `+` quick actions menu. |
|---|
header | ReactNode | — | Optional banner or context slot rendered at the top of the composer card (e.g. reply quote or approval notice). |
|---|
leadingActions | ReactNode | — | Optional custom controls rendered on the left side of the bottom toolbar after built-in pickers. |
|---|
trailingActions | ReactNode | — | Optional custom controls rendered on the right side of the bottom toolbar before voice/send. |
|---|
footerHint | ReactNode | — | Optional hint text rendered beneath the composer (e.g. keyboard shortcut or disclaimer). |
|---|
labels | Partial<ChatComposerLabels> | — | Localized labels and aria strings. |
|---|
className | string | — | Additional CSS class name applied to the root element. |
|---|
style | CSSProperties | — | Inline CSS styles applied to the root element. |
|---|