Search Documentation

Search for components, guides, and more.

Prompt Input

An input field that allows users to enter and submit text to an AI model.

Examples

Prompt Input Basics



Prompt input with actions

Add different file uplaod options to the prompt input, use PromptInputActions

Installation

pnpm dlx shadcn@latest add https://chatcn.me/c/prompt-input

Props

PromptInput

PropTypeDefaultDescription
valuestring-Controlled input value
onValueChange(value: string) => void-Callback when value changes
maxHeightnumber | string240Max height before scrolling
onSubmit() => void-Callback when form is submitted
childrenReact.ReactNode-Input content and actions
disabledbooleanfalseDisable the input
classNamestring-Additional CSS classes
isLoadingbooleanfalseLoading state

PromptInputTextArea

PropTypeDefaultDescription
disableAutoSizebooleanfalseDisable auto-resize behavior
classNamestring-Additional CSS classes

PromptInputAction

PropTypeDefaultDescription
tooltipReact.ReactNode-Tooltip content
childrenReact.ReactNode-Action button content
classNamestring-Additional CSS classes
side"top" | "bottom" | "left" | "right"-Tooltip position

PromptInputActions

PropTypeDefaultDescription
childrenReact.ReactNode-Action buttons
classNamestring-Additional CSS classes