Ballmac UI home

File Dropzone

Drop files or browse with native file selection, type and size validation, removable file rows, and live errors.

Attach project files

Drop files here or browse

Up to 3 files · 5 MB each

PDF or image files for this review.

Installation

$ pnpm dlx shadcn@latest add @ballmac/file-dropzone

Usage

import { FileDropzone } from "@/components/ballmac/file-dropzone"

The full example is in the Code tab above.

Examples

States and variants

Upload a profile image

Drop files here or browse

One file · 2 MB each

API reference

PropTypeDefault
accept

Accepted MIME types or extensions, in native input accept syntax.

string—
multiple

Allow more than one file.

booleantrue
maxFiles

Maximum number of files in the selection.

numbermultiple ? 5 : 1
maxSize

Maximum size of each file in bytes.

number10 * 1024 * 1024
files

Controlled file selection.

File[]—
defaultFiles

Initial selection when uncontrolled.

File[][]
onFilesChange

Called with the complete selection after add or remove.

(files: File[]) => void—
disabled

Disable browsing and dropping.

booleanfalse

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Tab / EnterOpens the native file chooser
DropAdds valid files
Tab / EnterRemoves a selected file

Use with AI

Drop files or browse with native file selection, type and size validation, removable file rows, and live errors. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI File Dropzone (@ballmac/file-dropzone) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Upload a document or group of assets
  • Review selected files before submitting

Not for

  • Use input for a minimal single-file field

Registry JSON: https://ui.ballmac.com/r/file-dropzone.json

Credits

Free to use in personal and commercial projects.