Usage

Configure Drop Upload through props on the <DropUpload /> component. The most commonly used settings are grouped here:

Size limits (minFileSize/maxFileSize), maxFiles, and allowedFormats are all enforced client-side — but this happens in the browser, so it helps users pick the right files rather than acting as a security boundary. Always validate uploads again in your own backend.

Full props reference

PropTypeDefaultDescription
borderSolidbooleanfalseDraws the drop area with a solid border instead of the default dotted one. Accent colors have their own props: dragBorderColor, spotlightColor and dropSmokeColor.
allowedFormatsstring[][]MIME types (or wildcards like "image/*") to accept. Rejected client-side.
allowedFormatsLabelMode"auto" | "auto-extended" | "custom" | "off""auto"Controls how allowed formats are described to the user.
allowedFormatsLabelCustomTextstring""Custom label text, used when labelMode is "custom".
maxFilesnumber0Maximum number of files that can be attached. 0 means unlimited. Extra files are never attached and are reported through onFilesRejected.
maxFileSizenumber0Maximum file size in KB. 0 means no limit. Rejected client-side.
minFileSizenumber0Minimum file size in KB. 0 means no limit. Rejected client-side.
instructionLabelstringlocale's instruction copyMain call-to-action text in the drop area.
locale"en" | "es""en"Language used for the component's built-in copy (instructions, retry, upload failed, etc.).
translationsPartial<DropUploadTranslations>undefinedOverride individual strings on top of the selected locale.
initialAttachedFileListAttachedFile[][]Pre-populate the attached file list.
variant"default" | "avatar""default"Shape of the drop area. "avatar" swaps the rectangle and the file list for a single circular well holding one image. Validation, uploads and callbacks are identical in both.
pasteToUploadbooleantrueAttach files pasted from the clipboard (Ctrl/Cmd+V), with the same validation as a drop. Pastes over an input, textarea or contenteditable are left alone, and with several uploaders on the page only one takes it.
avatarCropbooleantrueLet the visitor pan and zoom the image inside the circle before upload, so the adapter receives the crop and not the original. Only applies to variant="avatar" and to image files.
avatarCropSizenumber512Side in px of the square the cropper exports.
avatarSizenumber160Diameter in px of the circle drawn by variant="avatar".
fileListMode"list" | "stacked""list""stacked" shows only the most recent file and collapses the rest into a pile that expands on click.
autoHideDropAreabooleanfalseHide the drop area once at least one file is attached.
discardFileAwaitTimenumber700Long-press delay (ms) before a file can be discarded. 0 disables the long press.
debugModebooleanfalseShows the native file input and extra logging. Dev only.
spotlightbooleantrueToggles the hover spotlight effect in the drop area.
spotlightColorstring"#60a5fa"Color of the spotlight that follows the cursor while dragging files over the drop area. Any CSS color.
dragBorderColorstring"#3b82f6"Color of the inner border glow shown while dragging files over the drop area, and of the per-file progress bar. Any CSS color.
dropSmokebooleantruePuff of smoke thrown at the point a file lands on the drop area. Skipped anyway when the visitor asked their OS to reduce motion.
dropSmokeColorstringfollows the themeColor of that smoke. Any CSS color. Left alone, the cloud is grey on light and pale on dark.
onFilesDropped(files: FileList) => voidFires on drag-and-drop.
onFilesChanged(files: FileList) => voidFires on any file-input change (drop or click-to-browse).
onDiscardFile(file: AttachedFile) => voidFires when a file is removed.
onFilesRejected(rejectedFiles: RejectedFile[]) => voidFires when one or more files fail validation — size limits, disallowed type, spoofed content, too many files, or a dropped folder.
uploadAdapterUploadAdapterundefinedDrives the actual upload (see Uploading docs). Without it, files are only picked and previewed.
autoUploadbooleantrueStart uploading automatically once a file passes validation. Set false and each file waits for its own upload button in the list, or for the ref's startUpload().
onUploadComplete(file: AttachedFile) => voidFires when a file finishes uploading successfully. The file carries the url reported by the adapter.
onUploadError(file: AttachedFile, error: unknown) => voidFires when a file fails to upload.
onUploadCancel(file: AttachedFile) => voidFires when an upload in flight is aborted — the stop button, discarding the file, replacing the avatar's picture, or the cancelUpload() ref method. Not fired on unmount.
darkMode"dark" | "light" | "system""light"Color theme. "system" follows the visitor's OS preference (prefers-color-scheme) and updates live if it changes.