NK

Search

Search pages, posts, and components

All components

File Drop

Inputs

A drop zone whose upload icon bobs, inviting a drag.

Drag & drop files here

PNG, JPG or PDF up to 10MB

Installation

Add it with the shadcn CLI:

$pnpm dlx shadcn@latest add https://nawalkattel.com.np/r/file-drop.json
Or install manually
  1. 1. Install dependencies

    pnpm add motion clsx tailwind-merge lucide-react
  2. 2. Copy the component source into components/library/file-drop.tsx

Props

PropTypeDefaultDescription
labelstring"Drag & drop files here"Primary instruction.
hintstring - Secondary line, e.g. accepted formats.

Accessibility

  • Presentational - wire it to a real file input for keyboard access.
  • Hover state changes border and background, not colour alone.
  • Hint text sits in the DOM, so constraints are announced.

Dependencies

motionclsxtailwind-mergelucide-react