Skip to main content

Examples

Default

With Placeholder

With File Button

Full Feature

Disabled

Props

ChatInput

A chat-style multi-line input with an integrated toolbar containing an optional file-attach button, optional right-side controls (e.g. a model selector), and a submit button — all inside a single bordered container. Designed to behave like modern AI chat inputs: auto-grows with content, submits on Enter (Shift+Enter for newlines), and keeps controls inline.
ReactNode
Replaces the built-in attachment strip entirely. When set to any value other than undefined (including null or []), ChatInputProps.attachments is ignored.
ChatInputAttachmentItem[]
Image attachments shown in the built-in thumbnail strip. Ignored when ChatInputProps.attachmentPreviews is provided (including null).
string
Additional className applied to the outermost container.
string
default:"Attach file"
Accessible label for the attach-file button.
boolean
default:"false"
Whether a submission is in progress (disables submit, shows visual feedback).
number
default:"6"
Maximum number of visible rows before scrolling.
number
default:"1"
Minimum number of visible rows.
((id: string) => void)
Called when the user removes a built-in thumbnail. The remove button is disabled when this is omitted or the input is ChatInputProps.disabled.
(() => void)
Callback fired when the attach-file button is clicked. Only relevant when showFileButton is true.
((value: string) => void)
Callback fired when the user picks a different dropdown option.
((value: string) => void)
Callback fired when the user submits (clicks the send button or presses Enter without Shift). Receives the current trimmed text value.
boolean
default:"false"
When true, disables only the built-in dropdown selector.
string
default:"Select an option"
Title shown at the top of the "sheet" variant of the built-in selector (e.g. “Switch AI Model”).
ChatInputSelectOption[]
Options for the built-in inline dropdown selector (e.g. model picker). Ignored when toolbarRight is provided.
string
Currently selected value for the built-in dropdown. Should match one of selectOptions[].value.
"menu" | "sheet"
default:"menu"
How the built-in selector presents its options:
  • "menu" (default) — a dropdown anchored to the trigger, for pointer/desktop.
  • "sheet" — a bottom sheet, for mobile/touch viewports.
The viewport decision belongs to the consumer (it owns the breakpoint source of truth), so pass e.g. selectVariant={isDesktop ? "menu" : "sheet"}.
boolean
default:"false"
When true, renders an “attach file” button in the bottom-left toolbar.
string
default:"Send message"
Accessible label for the submit button.
ReactNode
default:"<ArrowUpIcon />"
Icon element for the submit button.
ReactNode
Optional content rendered in the bottom-right toolbar, to the left of the submit button. When provided, takes precedence over the built-in selectOptions dropdown.

Exported types

Also exported from @fanvue/ui: ChatInputAttachmentItem, ChatInputProps, ChatInputSelectOption.
Setup: Installation · Theming