Skip to main content
Version: Next

FileUpload API

import { FileUpload } from '@editora/ui-react';

Props​

PropTypeDescription
acceptstring
buttonTextstring
descriptionstring
disabledboolean
dropLabelstring
labelstring
maxFilesnumber
maxSizenumber
multipleboolean
namestring
onChange(files: File[]) => void
onReject(rejected: FileUploadRejectedFile[]) => void
onUploadCancel(detail: UploadLifecycleDetail) => void
onUploadComplete(detail: UploadLifecycleDetail) => void
onUploadError(detail: UploadLifecycleDetail) => void
onUploadProgress(detail: UploadLifecycleDetail) => void
onUploadRequestFileUploadUploadRequest
onUploadStart(detail: UploadLifecycleDetail) => void
onUploadSuccess(detail: UploadLifecycleDetail) => void
progressRecord<string, number>
requiredboolean
showPreviewsboolean
uploadButtonTextstring
uploadOnSelectboolean

Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).

Element: <ui-file-upload>​

FileUpload renders the ui-file-upload custom element from @editora/ui-core, which can also be used without React.

Attributes: accept, button-text, data-error, description, disabled, drop-label, label, max-files, max-size, multiple, name, progress, required, show-previews, surface, upload-button-text, upload-on-select

Events: change, clear, reject, upload-cancel, upload-complete, upload-error, upload-progress, upload-start, upload-success