A modern chat input component with a web search toggle and file upload functionality. This component features an animated search toggle, file attachment support, and smooth transitions. Features: • Animated search toggle button • File upload support • Auto-resizing textarea • Dark mode compatibility • Keyboard shortcuts • Framer Motion animations for enhanced user experience • Mobile responsiveness
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds AI Input With Search to your project and fits it to your theme.
Code
How AI Input With Search is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import { AIInputWithSearch } from "@/components/ui/ai-input-with-search";
export function AIInputWithSearchDemo() {
return (
<div className="space-y-8 min-w-[350px]">
<div>
<AIInputWithSearch
onSubmit={(value, withSearch) => {
console.log('Message:', value);
console.log('Search enabled:', withSearch);
}}
onFileSelect={(file) => {
console.log('Selected file:', file);
}}
/>
</div>
</div>
);
}







