Prompt Input

The text box where people talk to your agent: it grows with the draft up to a row limit, sends on Enter with Shift+Enter for a new line, offers a model picker and a prompt action menu, and swaps send for stop during a reply.

Preview

Prompt Input preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/prompt-input
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

value?
string
—
defaultValue?
string
onValueChange?
((value: string) => void)
—
models?
PromptModel[]
[]
model?
string
—
defaultModel?
string
—
onModelChange?
((model: string) => void)
—
actions?
PromptAction[]
[]
onAction?
((action: string) => void)
—
onSubmit?
((value: string, model?: string) => void | Promise<void>)
—
loading?
boolean
false
onStop?
(() => void)
—
minRows?
number
2
maxRows?
number
8
leadingAction?
ReactNode
—
className?
string
—

Composition

Keep the composer next to the transcript, outside it, so a half-written prompt never scrolls away with old messages.

Chat
├── MessageScroller
│   └── MessageGroup
└── PromptInput

Note: Message Scroller holds the transcript steady above the composer. Tool Approval asks for a yes or no on one tool before free typing resumes. Approval Card gathers structured answers while the run waits.

How it works

This is where a person hands work to the agent. The draft should stay editable, the tools on offer should be easy to find, and sending a new request must never be confused with stopping the current one.

Updated