FileUpload

The FileUpload component allows users to upload files with validation options such as size, type, and progress feedback.

Usage

Default

<FileUpload label="Upload your document" onSubmit={...}/>

Props

Sortable data table
PropTypeDefaultDescription
labelstring"Upload File"Label for the file upload input.
descriptionstring-Short helper text or instructions below the label.
errorstring-Error message displayed below the input.
requiredbooleanfalseMarks the field as required.
disabledbooleanfalseDisables the file input.
multiplebooleanfalseAllow multiple files to be selected.
allowedFileTypesArray<string>-List of allowed file MIME types (e.g. ['image/png', 'application/pdf']).
maxFileSizeBytesnumberinfinityMaximum allowed file size in bytes. Default: Infinity.
theme"primary" | "secondary" | "tertiary" | "quaternary" | "clear"Configured DefaultTheme color for the input.
state"" | "success" | "error" | "warning"-State variant for status feedback.
outlinebooleanfalseDisplay the control in outlined style.
outlineRounding"none" | "small" | "medium" | "large"Configured DefaultBorder radius for the outlined box.
outlineShadow"none" | "light" | "medium" | "strong" | "intense"Configured DefaultBox shadow for the outlined box.
controlRounding"none" | "small" | "medium" | "large"Configured DefaultBorder radius for the upload button.
controlShadow"none" | "light" | "medium" | "strong" | "intense"Configured DefaultBox shadow for the upload button.
uploadProgressnumber-Current upload progress percentage (0–100) if externally controlled.
onSubmit(files: FileList) => void-Callback fired when the user confirms file upload.
data-testidstring"file-upload"Test ID for query selectors in testing.