Prompt Box
Spring-animated AI prompt with model controls and voice or send.
Installation
npx shadcn@latest add @iconiq/prompt-boxProps
PromptInput
8 props
Expandable prompt surface that grows from a compact pill into a textarea with model controls, attachment action, and send or voice affordances.
onSubmit
(value: string) => voidCalled with the trimmed prompt when the user presses Enter without Shift or clicks the send button.
placeholder
stringPlaceholder copy for the collapsed and expanded prompt field.
menuActions
PromptMenuAction[]Optional dropdown actions rendered above setting groups. Each action has `label`, optional `icon`, and `onSelect`.
plusMenuItems
PromptPlusMenuItem[]Items for the plus-button add menu. Actions use `onSelect` with optional `shortcut`. Submenus pass `options` and `onOptionSelect`.
settingGroups
PromptSettingGroup[]Grouped settings for the footer menu. Use `display: "featured"` for a selected summary row, `display: "submenu"` for a value row with flyout, and `moreMenuLabel` for an extra picker row (e.g. More models). Options support optional `description` text.
settings
Record<string, string>Controlled map of selected values keyed by setting group id.
defaultSettings
Record<string, string>Initial selected values for uncontrolled usage, keyed by setting group id.
onSettingsChange
(settings: Record<string, string>) => voidCalled when the user picks a new option in any settings group.
Notes
Built on Base UI Input — collapsed state uses a read-only field, expanded state renders a textarea through the `render` prop.
Click the collapsed field to expand and focus the prompt input.
Press Enter to submit when the field has content; Shift+Enter inserts a newline.
The expanded surface starts compact and grows with your prompt up to 300px, then scrolls inside the textarea.
Press Escape or blur away with an empty draft to collapse back to the compact pill.
The settings menu shows optional `menuActions`, then featured model rows, submenu rows with current values, and optional more-menu flyouts separated by dividers.
The plus button opens an optional add menu when `plusMenuItems` is provided. Items support icons, keyboard shortcuts, and nested submenus.
The footer reveals the settings popover and plus add menu while expanded.
The trailing action button shows a microphone icon when empty and an arrow icon once text is entered.