uimaxxer

File drop

Drag files over the well and its floor sinks away. Let go and they fly into the list, each row filling as it uploads. Remove one and you have five seconds to undo.

npx shadcn@latest add @uimaxxer/file-drop
Pro
PasskeysContext

Context

Context for this run

Drop files, or click to browsePDF, CSV, Markdown, code or images, up to 25 MB
  • q3-revenue-by-region.csv

    184 KB

  • refund-policy-2026.md

    14 KB

Usage

import { FileDrop } from "@/components/ui/file-drop"

<FileDrop
  accept=".pdf,.csv,image/*"
  maxSize={25 * 1024 * 1024}
  onUpload={(file, progress, signal) => upload(file, { onProgress: progress, signal })}
/>

Props

PropTypeDefaultWhat it does
onUpload(file: File, progress: (fraction: number) => void, signal: AbortSignal) => Promise<void>Uploads one file. Report progress from 0 to 1; reject to mark it failed. The signal aborts on remove.
onFilesChange(files: DropFile[]) => voidEvery file still in the list, with its status and progress.
acceptstringAs the input attribute, e.g. ".pdf,.csv,image/*". Other files are listed with an error.
maxSizenumberBytes. Larger files are listed with an error and never uploaded.
multiplebooleantrueAccept more than one file.
defaultFiles{ name: string; size: number; type?: string }[]Files already uploaded.
label / hintReactNodeThe well's line, and what it accepts.
undoFornumber5000How long a removed file can come back, in ms.

Keyboard

Enter / Space
Open the file browser
Tab
To each file's remove and undo buttons

Accessibility

  • The well is a button that opens the native file picker, so keyboard and screen readers never need drag and drop.
  • Each uploading row carries a progressbar with its percentage.
  • Adds, removals and undos are announced through a polite live region.