Skip to content
Browse docs and components

Prompt Input

prompt-input

The composer for an AI chat. Enter sends and Shift+Enter breaks a line without ever sending half an IME word. It grows with the text, takes pasted images as attachments, has a slot for model pickers and toggles, and its send button turns into stop while a reply streams.

Responsive

Install

$npxshadcnadd@forme/prompt-input

Adds the component, its registry dependencies, and the token stylesheet you import once.

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

PromptInput

The composer at the bottom of every chat.

PropTypeDefaultDescription
onSubmit*(prompt: { text: string; files: File[] }) => void—Called with the text and the attached files. Clear the field by returning.
streamingbooleanfalseWhile true the send button becomes a stop button and calls onStop.
onStop() => void—
placeholderstring"Ask anything…"
labelstring"Message"Accessible name for the field.
attachmentsbooleantrueAllows attachments through a paperclip button and by pasting images.
toolbarReactNode—Controls in the footer, left of the send button: a model picker, toggles.
disabledboolean—
classNamestring—