File Dropzone
A React drag and drop upload zone with accept and reject states, type and size checks, image previews, per file progress, retry and screen reader updates.
src/registry/ui/file-dropzone.tsx/r/file-dropzone.json
Any file, with upload progress
Drop files to upload
Browse or drag here · up to 20.0 MB
Images only, one at a time
Upload a logo
Browse or drag here · PNG, JPEG, WEBP · up to 5.0 MB
Drag a file over it
Installation#
bash
npx shadcn@latest add @minidev/file-dropzone
MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/file-dropzone.json
Usage#
tsx
import { FileDropzone } from "@/components/ui/file-dropzone"
export function Example() {
return <FileDropzone />
}
API reference#
| Prop | Type | Default |
|---|---|---|
onFiles | (files: File[]) => void | - |
upload | (file: File, onProgress: (p: number) => void) => Promise<void> | - |
accept | string | - |
multiple | boolean | true |
maxSize | number | - |
maxFiles | number | - |
disabled | boolean | - |
showList | boolean | true |
label | string | "Drop files to upload" |
hint | string | - |
className | string | - |
Dependencies#
npm
lucide-react
Built from
No other MiniDev files
Related forms components#
AutocompleteText input that filters string options as you type, using ARIA combobox and listbox roles. Works controlled or uncontrolled and lists up to eight matches.Calendar MonthMonth calendar grid with weekday headers and clickable day cells that highlight the selected date. A simple Tailwind base for date views and schedulers.Character CountLive React character counter that shows the current count against a limit and turns red when it goes over. Announces changes politely to screen readers.Checkbox GroupVertical wrapper that groups related checkboxes under role group with even spacing. Use it with Checkbox and labels for multi select settings.CheckboxShadcn style checkbox on Base UI with an animated check, indeterminate state, invalid and disabled styles, and an enlarged hit area for touch.Chip FilterSingle select filter chips in React that behave as a radio group, with an accent ring on the active chip. Good for quick filters above lists and tables.
All form components