PromptInput
Auto-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/cli@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.
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+ — macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA — the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.