Chat
PromptInput
Where a question is written. The field grows with the text up to a limit; ⌘↵ or Ctrl↵ sends and ↵ keeps a new line. While a reply streams the send button is a stop button. Suggestions above it send with a click. No model and no network: it hands the text to onSubmit.
Preview
⌘↵ or Ctrl↵ sends; ↵ is a new line
Installation
// Resolves dependencies, copies the source, and installs npm packages automatically.
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| onSubmit | (text) => void | - | Trimmed; an empty one never goes |
| value, defaultValue, onValueChange | string | - | Controlled or not |
| streaming, onStop | boolean, () => void | - | Send becomes stop |
| suggestions | string[] | - | A click sends one |
| tools | ReactNode | - | Buttons on the left of the toolbar |
| maxHeight | number | 200 | Tallest before it scrolls |
| label | string | "Message" | The field's name |