Prompt Input

An AI chat composer that grows with its content, sends on Enter, adds a newline on Shift Enter and has attach, toolbar and send controls. Built for React.

src/registry/ui/prompt-input.tsx/r/prompt-input.json

Installation#

bash
npx shadcn@latest add @minidev/prompt-input

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/prompt-input.json

Usage#

tsx
import { PromptInput } from "@/components/ui/prompt-input"

export function Example() {
  return (
    <PromptInput value={prompt} onChange={setPrompt} onSubmit={() => setPrompt("")} />
  )
}

API reference#

PromptInput props
PropTypeDefault
valuestring-
onChange(v: string) => void-
onSubmit() => void-
disabledboolean-
classNamestring-
placeholderstring"Message…"
toolbarReact.ReactNode-

Dependencies#

npm

lucide-react

Built from

No other MiniDev files

Examples#

All AI chat UI components for React

Learn more