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.

view .md
Preview
⌘↵

⌘↵ or Ctrl↵ sends; ↵ is a new line

Installation
terminal
bash
npx @entrepta/cli@latest add prompt-input

// Resolves dependencies, copies the source, and installs npm packages automatically.

Usage
prompt-input.tsx
tsx
import { PromptInput } from "@/components/entrepta/prompt-input"

<PromptInput
  onSubmit={send}
  streaming={busy}
  onStop={stop}
  suggestions={["Spending this month", "Biggest category"]}
  tools={<Button variant="ghost" size="icon-sm" aria-label="Attach">…</Button>}
/>
Props
PropTypeDefaultDescription
onSubmit(text) => void-Trimmed; an empty one never goes
value, defaultValue, onValueChangestring-Controlled or not
streaming, onStopboolean, () => void-Send becomes stop
suggestionsstring[]-A click sends one
toolsReactNode-Buttons on the left of the toolbar
maxHeightnumber200Tallest before it scrolls
labelstring"Message"The field's name
Active theme: entrepta, dark mode.