Upload

Upload is a component that allow user to attach files & images, it can be used with form and upload the data to some where else.

Basic

A basic Upload example.

Drag and Drop

With draggable prop, we can drag files to a specific area to proceed upload.

Disabled

Disabled the Upload component by setting disabled to true.

Customize

We can replace the default upload look.

Upload Control

Use beforeUpload prop to make a callback function to validate file before upload.

Avatar

An example for avatar upload

API

Upload
PropDescriptionTypeDefault
acceptFile types that can be accepted as input accept attributestring-
beforeUploadThe callback function that before file upload, return false or string with value to intercept the upload(file: FileList | null, fileList: File[]) => boolean | string-
disabledWhether to disable Uploadbooleanfalse
draggableWhether enable draggable uploadbooleanfalse
fileListInitial file listFile[][]
fileListClassClass for file list wrapperstring-
fileItemClassClass for file itemstring-
onChangeCallback function after file uploaded(file: File[], fileList: File[]) => void-
onFileRemoveCallback function when a file was deleted(file: File[]) => void-
showListWhether to show uploaded file listbooleantrue
tipHint message under Uploadstring | ReactNode-
uploadLimitMaximum file to uploadnumber-