Upload
freeUpload handles file selection, drop zones, validation, and removable file lists.
Drag and Drop file here or Choose file
Supported formats: XLS, XLSXMaximum size: 25MB
Table Name.xls
3 MB
Installation
Add this component with the NateUI CLI.
Examples
Basic
Drag And Drop
Drop files here or browse
Multiple documents can be attached at once.
Custom Trigger
Validation
Supported formats: PNG, JPEG. Maximum size: 500 KB.
Avatar Image
Profile photo
Controlled
Controlled file count
2 filesVendor-agreement.pdf
232 kbInvoice-export.zip
118 kbCustom File Item
Recording.mp3
audio/mpeg4180 KB
Release-notes.txt
text/plain21 KB
Archive.zip
application/x-zip-compressed1620 KB
Disabled
Uploading is unavailable for archived records.
API
Upload manages browser file selection and an in-memory list of selected files. It does not send files to a server by itself; use onChange, beforeUpload, and customFileItem to connect it to the workflow around it.
| Prop | Description | Type | Default |
|---|---|---|---|
accept | File accept string forwarded to the hidden file input. | string | - |
beforeUpload | Synchronously validates selected files before they are added to the list. Return false or a message string to block them. | UploadBeforeUpload | - |
children | Custom trigger content. Without children, Upload renders its default button or dropzone text. | ReactNode | - |
customFileItem | Custom renderer for each listed file. Receives the file, index, remove callback, and internal FileIcon renderer. | UploadCustomFileItem | - |
disabled | Prevents file selection and applies disabled styling. | boolean | false |
draggable | Renders a dashed drop area and enables drag-over feedback. | boolean | false |
fileList | Controlled file list. When omitted, Upload stores selected files internally. | File[] | - |
fileListClass | Class names applied to the file-list wrapper. | string | - |
fileItemClass | Class names applied to default file rows. | string | - |
multiple | Allows selecting more than one file. | boolean | - |
onBeforeUpload | Called when beforeUpload blocks a file, with false or the returned message. | (result: boolean | string) => void | - |
onChange | Called after a valid file is added. Receives the first selected file and the full list. | UploadChangeHandler | - |
onFileRemove | Called after a file is removed. Receives the removed file and the next list. | UploadRemoveHandler | - |
showList | Shows the selected file list below the trigger. | boolean | true |
tip | Hint content rendered below the trigger. | string | ReactNode | - |
uploadLimit | Limit checked before adding another selection. When set to 1, the next valid upload replaces the current file. | number | - |
className | Extra classes for the root upload container. | string | - |
ref | Ref forwarded to the root upload container. | Ref<HTMLDivElement> | - |
...nativeProps | Native props forwarded through the root container type. | UploadNativeProps | - |