Installation
Overview
An advanced AI prompt input component featuring model selection, file attachments, and auto-resizing textarea. This component provides a polished interface similar to modern AI chat applications like Claude or ChatGPT.Features
- Model selection dropdown with animated transitions
- Auto-resizing textarea that grows with content
- File attachment support
- Custom AI model icons (OpenAI, Anthropic, Gemini)
- Submit on Enter (Shift+Enter for new line)
- Dark mode support
- Promotional banner section
Props
This component doesn’t expose props - it’s a complete demo implementation. You can customize it by modifying:AI_MODELSarray - List of available AI modelsMODEL_ICONSobject - Icon mapping for each modelminHeightandmaxHeightinuseAutoResizeTextareahook
Component Structure
State Management
Key Features
Auto-resize Textarea: Uses theuseAutoResizeTextarea hook to dynamically adjust height based on content.
Model Selection: Dropdown menu with animated model switching using Framer Motion’s AnimatePresence.
Keyboard Shortcuts: Enter to submit, Shift+Enter for new line.
Usage Example
Dependencies
lucide-react- Icons (ArrowRight, Bot, Check, ChevronDown, Paperclip)motion(framer-motion) - Animations for model switching@/components/ui/button- Button component@/components/ui/dropdown-menu- Dropdown menu component@/components/ui/textarea- Textarea component@/hooks/use-auto-resize-textarea- Auto-resize hook@/components/icons/anthropic- Anthropic icon components
Customization
To add your own AI models:Related Components
- AI Input Search - Simpler AI input with web search toggle
- AI Loading - Loading state for AI processing