Composer
The prompt box: grows with text, attachments by button, drag & drop or paste, a toolbar slot, voice, and Send that becomes Stop.
import { Composer } from "pleate/ai/composer";Card, capsule and minimal
Paste an image, or drop files on it. The capsule swaps the mic for Send as soon as you type.
Props
- onSubmit
Enter or the send button; clears after.
({ text, files }) => void- generating / onStop
Stop mode.
boolean / () => void- accept / maxFiles
Enables attachments.
string / numberdefault none / 8- onVoice / listening
Mic button.
() => void / boolean- toolbar
Model picker, tools.
ReactNode- variant
A box with a toolbar row, or one line like the Messages input.
"card" | "capsule"default "card"- value / onValueChange / labels
Controlled text and translatable labels.
Accessibility
- Enter sends, Shift+Enter breaks the line; IME composition is respected.