File Upload
Drop Zone Upload
A drag and drop area with marching dashes and a file list with animated progress bars.
npx motionsnack add drop-zone-uploadCustomize
<DropZoneUpload />Props
35 properties
| Property | Type | Default | Description |
|---|---|---|---|
| value | UploadFile[] | - | Files in the list. With a value the component is controlled. |
| defaultValue | UploadFile[] | 2 demo files | Files in the list at the start when uncontrolled. UploadFile = { id, name, size (bytes), type, url?, progress?, status?, error? }. |
| onChange | (files: UploadFile[]) => void | - | Called with the new list after files are added, removed or change status. |
| onUpload | (file: File, onProgress: (progress: number) => void) => Promise<void> | - | Uploads one file. Without it added files count as done. |
| name | string | - | Field name of the native file input. |
| id | string | useId() | Id of the native file input; label, helper and error ids derive from it. |
| labels | DropZoneUploadLabels | English | Row button names, statuses, rejection messages and announcements. |
| locale | string | 'en-US' | BCP 47 locale of file sizes and percentages. |
| errorColor | string | undefined | Error colour on both themes. Undefined uses the per-theme pair. |
| successColor | string | undefined | Success colour on both themes. Undefined uses the per-theme pair. |
| defaultFiles | { name: string; sizeMb: number }[] | - | Deprecated alias of defaultValue. |
| onFiles | (files: File[]) => void | - | Deprecated: use onChange. Still called with the accepted files. |
| onRemove | (name: string) => void | - | Deprecated: use onChange. Still called with the removed file's name. |
| doneLabel | string | - | Deprecated: use labels.uploaded. |
| uploadingLabel | string | - | Deprecated, ignored. |
| accent | string | - | Deprecated, ignored: the zone edge is the functional border. |
| accentTo | string | - | Deprecated, ignored. |
| radius | number | - | Deprecated, ignored: the zone is radius 12. |
| uploadSeconds | number | - | Deprecated, ignored: pass onUpload for real progress. |
| dashSpeed | number | - | Deprecated, ignored: the edge is solid. |
| tint | number | - | Deprecated, ignored. |
| className | string | '' | Extra classes on the root. |
| label | string | 'Attachments' | Visible label above the zone. Empty hides it. |
| helperText | string | '' | Helper text under the zone. Empty hides it. |
| error | string | '' | Error message: colours the zone edge and replaces the helper. |
| title | string | 'Drop files here' | Title inside the zone. |
| dragTitle | string | 'Drop to add them' | Title while a file is held over the zone. |
| hint | string | 'Up to 4 files, 10 MB each.' | Hint under the title: types and size. |
| browseLabel | string | 'Browse files' | Label of the button that opens the file picker. |
| accept | string | '' | Accepted types, as in the native attribute: ".pdf,image/*". Empty accepts everything. |
| maxFiles | number | 4 | Most files the list can hold. 0 means no limit. |
| maxSizeMb | number | 10 | Largest size of one file (base 10). 0 means no limit. |
| multiple | boolean | true | Allow several files at once. |
| required | boolean | false | A file is required. |
| disabled | boolean | false | Blocks the zone, the picker and drops. |
About Drop Zone Upload
Drop Zone Upload is a dashed drop area with a browse button and a list of the files you add. While a file is held over it, the dashes of the border start marching, an accent tint rises from the bottom edge and the upload icon lifts on a spring. Dropped or picked files slide into the list, each with its size, a progress bar that fills on a timer and a check that pops in when it finishes. Rows collapse smoothly when you remove them. The accept, maxFiles and maxSizeMb props filter what gets in and a short notice says what was skipped. Nothing is uploaded anywhere: onFiles hands you the accepted files to send yourself.
What's included
- Dashed border that marches while a file is dragged over
- Accent tint and spring-lifted icon on drag
- File rows that slide in and collapse on remove
- Simulated, timer-driven progress bar with a finish check
- accept, maxFiles and maxSizeMb checks with a skipped notice
- onFiles and onRemove callbacks, no network calls
- Keyboard friendly browse and remove buttons
- Type
- Animated React file upload component
- Library
- Components · File Upload
- Stack
- Next.js, React, Tailwind CSS
- Added
- 2026-09-20