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@latest add prompt-input
Basic
Compound primitives
Search the web⌘K

Props

PropTypeDefaultDescription
onSubmit(value: string) => void—Called with the trimmed value on submit
onStop() => void—While loading, the button becomes Stop and calls this
placeholderstring'Type your message...'Textarea placeholder
disabledbooleanfalseDisables the whole input
isLoadingbooleanfalseBlocks submits; enables stop state when paired with onStop
maxLengthnumber—Maximum character count
autoFocusbooleanfalseFocus the textarea on mount
showSendButtonbooleantrueShow/hide the action button
sendButtonTextstring'Send'Accessible label for the send button
stopButtonTextstring'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.