Skip to main content
The MessageInput component provides a user-friendly input interface for chat applications. It features auto-resizing textarea, Enter to send functionality, and dynamic send/stop button states based on chat status.

Installation

Install the MessageInput component using the shadcn CLI:

Usage

Props

ChatStatus
required
The current chat status. Controls the input state and button appearance (send vs stop).
(content: string) => void
Callback function called when the user sends a message. Receives the trimmed message content.
() => void
required
Callback function called when the user wants to stop AI response generation.
string
Additional CSS classes to apply to the input container.