AI
PromptInput
Chat composer — auto-growing textarea in an input-shaped shell, Enter to send, Shift+Enter for a newline, and a send button that flips to stop while a response streams.
Examples
Composer
<PromptInput
placeholder="Ask anything…"
{busy}
onSubmit={(v) => send(v)}
onStop={() => abort()}
/>Header + actions slots
README.md tokens.css
<PromptInput onSubmit={send}>
{#snippet header()}
<Chip>README.md</Chip>
<Chip>tokens.css</Chip>
{/snippet}
{#snippet actions()}
<Button variant="ghost" size="sm">@</Button>
{/snippet}
</PromptInput>Disabled
<PromptInput disabled placeholder="Read-only session" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | string (bindable) | — | The draft text. |
placeholder | string | — | Default "Message…". |
busy | boolean | — | Send flips to a stop button for the streamed response. |
disabled | boolean | — | Dims and locks the composer. |
maxRows | number | — | Auto-grow cap in text lines. Default 8. |
onSubmit | (value: string) => void | — | Enter or send — value arrives trimmed, input clears. |
onStop | () => void | — | Stop button while busy. |
header | Snippet | — | Row above the textarea — context chips, attachments. |
actions | Snippet | — | Buttons left of send — use <Button size="sm" icon>. |
Install
CLI
npx @a3tai/mittsu add prompt-input