Components / AI components / Conversation
ConversationExperimental alpha

PromptInput

An intentional start to every conversation.

PromptInput preview

Shift + Enter for a new line

Interactions use local sample data.

Usage and props

Use standard for the main composer, compact in a small panel and inline for a short follow-up. Keep the draft in application state and explain why sending is unavailable. The host accepts the prompt and confirms cancellation.

valuestring
The controlled draft. Clear it when your application is ready to do so.
onValueChange(value: string) => void
Update value with the edited draft.
onSubmit(text: string) => void
Receives the trimmed draft. Send it through your application and track the result there.
busyboolean (optional)
Prevents another send while a response is in progress.
submitDisabledboolean (optional)
Disables sending while keeping the draft editable.
submitDisabledReasonstring (optional)
The explanation shown when submitDisabled is true.
attachmentsReactNode (optional)
Content above the draft, such as attachment previews. Handle uploads separately.
How state and callbacks work

These are the main props for the example. The package's TypeScript declarations include the full API.

Customize and use with a keyboard