Kokonut UI

AI Input With File

Component 95

About

An enhanced chat input component with file upload capabilities. It features an auto-resizing textarea, file attachment preview, and submit button. Features: • File upload with preview • Auto-resizing textarea • File type restrictions • File size limits • Dark mode support • Mobile responsiveness • Keyboard shortcuts • Animated UI elements

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds AI Input With File to your project and fits it to your theme.

Code

How AI Input With File is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { AIInputWithFile } from "@/components/ui/ai-input-with-file"

export function AIInputWithFileDemo() {
  const handleSubmit = (message: string, file?: File) => {
    console.log('Message:', message);
    console.log('File:', file);
  };

  return (
    <div className="space-y-8 min-w-[400px]">
        <AIInputWithFile 
          onSubmit={handleSubmit}
        />
    </div>
  );
}

Dependencies

More by Kokonut UI

View all
  • Background Paths

    Background Paths

    5.7K
  • Shape Landing Hero

    Shape Landing Hero

    3.5K
  • Beams Background

    Beams Background

    2.8K
  • Bento Grid

    Bento Grid

    2.2K
  • v0 AI Chat

    v0 AI Chat

    2.1K
  • AI Voice Input

    AI Voice Input

    1.7K
  • Hand Writing Text

    Hand Writing Text

    1.3K
  • Action Search Bar

    Action Search Bar

    1.3K