ai 2

File Input

Forms 6

About

A styled file picker that hides the native file input under a custom surface with a leading icon, selected file name (or multi-file count), and an optional clear button.

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

Code

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

Usage.tsx

import { FileInput } from "@/components/ui/file-input";

export default function FileInputDemo() {
  return (
    <div className="flex w-full max-w-sm flex-col gap-3">
      <FileInput aria-label="Upload attachment" />
      <FileInput
        variant="soft"
        size="sm"
        placeholder="Attach a logo"
        aria-label="Upload logo"
      />
      <FileInput
        tone="danger"
        placeholder="PNG or SVG, max 2 MB"
        aria-label="Upload avatar"
        aria-invalid="true"
      />
    </div>
  );
}

Dependencies

More by ai 2

View all
  • Ripple Buttons

    Ripple Buttons

    31
  • Styled Toggle Switches

    Styled Toggle Switches

    14
  • Styled Progress Bars

    Styled Progress Bars

    14
  • Styled Badges

    Styled Badges

    10
  • OTP Pin Input

    OTP Pin Input

    8
  • Particle Toggles

    Particle Toggles

    7
  • Input Group Glass

    Input Group Glass

    6
  • Combo Kbd

    Combo Kbd

    6

More in Forms

View all
  • Premium Auth

    Premium Auth

    500
  • Login 2

    Login 2

    7
  • Authentication Card

    Authentication Card

    47
  • Login 1

    Login 1

    52
  • Contact Card

    Contact Card

    1K
  • Login Form

    Login Form

    6
  • Form

    Form

    16
  • Book A Demo 3

    Book A Demo 3

    83