Installation
Overview
A sleek AI input component with an integrated web search toggle. Perfect for AI applications that combine conversational AI with web search capabilities.Features
- Auto-resizing textarea with smooth transitions
- Animated web search toggle button
- File attachment support
- Focus state management
- Submit on Enter (Shift+Enter for new line)
- Animated globe icon with rotation effects
- Expanding “Search” label animation
- Dark mode support
Props
This component doesn’t expose props - it’s a complete demo implementation. Customize by modifying the internal state and handlers.Component Structure
State Management
Key Features
Auto-resize: Textarea automatically grows from 52px to 200px max height. Search Toggle: Animated button that expands/collapses with smooth transitions. Focus Management: Ring indicator changes opacity based on focus state.Usage Example
Customization
Change Placeholder
Adjust Height Limits
Custom Search Icon
Replace theGlobe icon with your preferred icon:
Animation Details
Globe Rotation
The globe icon rotates when search is enabled and on hover:Label Expansion
The “Search” label smoothly expands/collapses:Dependencies
lucide-react- Icons (Globe, Paperclip, Send)motion(framer-motion) - Smooth animations@/components/ui/textarea- Textarea component@/hooks/use-auto-resize-textarea- Auto-resize functionality
Related Components
- AI Prompt - Full-featured AI prompt with model selection
- AI Loading - Loading state indicator