Select file or drag here
Select file or drag here
Attach up to 2 files.Button
Use the children
node to overwrite the default dropzone interface. Allow for a custom interface.
Disabled
Select file or drag here
Bind to API
You can optionally bind to the internal Zag component API to access additional methods such as clearFiles()
.
Select file or drag here
RTL
Select file or drag here
Additional Features
Accepted File Formats
File Validation
Custom Validation
Events
Image Previews
Miscellaneous
API Reference
FileUpload
Property | Type | Description |
---|---|---|
label | string | |
subtext | string | |
base | string | |
classes | string | |
interfaceBase | string | |
interfaceBg | string | |
interfaceBorder | string | |
interfaceBorderColor | string | |
interfacePadding | string | |
interfaceRounded | string | |
interfaceClasses | string | |
interfaceIcon | string | |
interfaceText | string | |
interfaceSubtext | string | |
filesListBase | string | |
filesListClasses | string | |
fileBase | string | |
fileBg | string | |
fileGap | string | |
filePadding | string | |
fileRounded | string | |
fileClasses | string | |
fileIcon | string | |
fileName | string | |
fileSize | string | |
fileButton | string | |
stateDisabled | string | |
stateInvalid | string | |
stateDragging | string | |
iconInterface | ReactNode | |
iconFile | ReactNode | |
iconFileRemove | ReactNode | |
internalApi | (api: FileUploadApi) => void | |
children | ReactNode | |
name | string | |
ids | Partial<{ root: string; dropzone: string; hiddenInput: string; trigger: string; label: string; item(id: string): string; itemName(id: string): string; itemSizeText(id: string): string; itemPreview(id: string): string; }> | |
translations | IntlTranslations | |
accept | Record<string, string[]> | FileMimeType | FileMimeType[] | |
disabled | boolean | |
required | boolean | |
allowDrop | boolean | |
maxFileSize | number | |
minFileSize | number | |
maxFiles | number | |
validate | (file: File, details: FileValidateDetails) => FileError[] | |
onFileChange | (details: FileChangeDetails) => void | |
onFileAccept | (details: FileAcceptDetails) => void | |
onFileReject | (details: FileRejectDetails) => void | |
capture | "user" | "environment" | |
directory | boolean | |
invalid | boolean | |
locale | string | |
dir | "ltr" | "rtl" | |
getRootNode | () => ShadowRoot | Node | Document | |