PromptInput
Markdown for agentsAuto-resizing chat input with Enter-to-send, Shift+Enter for newlines, and a stop-generation button while a response is in flight. Also composes as a compound primitive set for custom layouts.
npx slipstream-ui@latest add prompt-inputBasic
Compound primitives
Search the web⌘K
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| onSubmit | (value: string) => void | — | Called with the trimmed value on submit |
| onStop | () => void | — | While loading, the button becomes Stop and calls this |
| placeholder | string | 'Type your message...' | Textarea placeholder |
| disabled | boolean | false | Disables the whole input |
| isLoading | boolean | false | Blocks submits; enables stop state when paired with onStop |
| maxLength | number | — | Maximum character count |
| autoFocus | boolean | false | Focus the textarea on mount |
| showSendButton | boolean | true | Show/hide the action button |
| sendButtonText | string | 'Send' | Accessible label for the send button |
| stopButtonText | string | 'Stop generating' | Accessible label for the stop button |
Accessibility
- Enter submits; Shift+Enter inserts a newline.
- Whitespace-only input is never submitted.
- The icon-only button carries an accessible label (localizable).
- The textarea is disabled while loading, preventing double submits.