Prompt Input
An auto-growing agent composer with attachment, model, submit, and stop controls.
Installation
Add the component source directly to your project.
pnpm dlx shadcn@latest add https://pastaui.com/r/prompt-input.jsonAPI reference
Prompt Input
| Prop | Type | Default | Description |
|---|---|---|---|
onToolSelect | (tool: PromptTool) => void | — | Handles the plus-menu actions. Connect library, image, search, maps, research, sketch, visualization, and platform tools in your app. |
onFilesChange | (files: File[]) => void | — | Receives locally selected files. Files are included in the submit selection; upload them in your app. |
models / moreModels | ModelOption[] | OpenAI and Claude models | Configures the embedded Model Picker options and More models submenu. |
onModelChange | (model: string) => void | — | Receives model selections. |
effort / onEffortChange | ModelEffort / (effort: ModelEffort) => void | medium / — | Controls reasoning effort in the embedded picker. |
onSubmit | (value: string, selection: { model: string; effort: ModelEffort; tool?: PromptTool; files: File[] }) => void | — | Receives a trimmed prompt, selected model and effort, active tool, and local files. |
pending | boolean | false | Changes the submit action into a stop control. |
model | string | First available model | Controls the selected model ID. |