diff --git a/src/mantine-dropzone/src/Dropzone.tsx b/src/mantine-dropzone/src/Dropzone.tsx
index a5a33b993fd..22d2c7bb8ec 100644
--- a/src/mantine-dropzone/src/Dropzone.tsx
+++ b/src/mantine-dropzone/src/Dropzone.tsx
@@ -1,5 +1,12 @@
import React from 'react';
-import { useDropzone, FileRejection, Accept, FileWithPath } from 'react-dropzone';
+import {
+ useDropzone,
+ FileRejection,
+ Accept,
+ FileWithPath,
+ DropEvent,
+ FileError,
+} from 'react-dropzone';
import {
DefaultProps,
Selectors,
@@ -97,6 +104,12 @@ export interface DropzoneProps
/** Set to true to use the File System Access API to open the file picker instead of using an click event, defaults to true */
useFsAccessApi?: boolean;
+
+ /** Use this to provide a custom file aggregator */
+ getFilesFromEvent?: (event: DropEvent) => Promise>;
+
+ /** Custom validation function. It must return null if there's no errors. */
+ validator?: (file: T) => FileError | FileError[] | null;
}
export const defaultProps: Partial = {
@@ -144,6 +157,8 @@ export function _Dropzone(props: DropzoneProps) {
onFileDialogOpen,
preventDropOnDocument,
useFsAccessApi,
+ getFilesFromEvent,
+ validator,
...others
} = useComponentDefaultProps('Dropzone', defaultProps, props);
@@ -173,6 +188,8 @@ export function _Dropzone(props: DropzoneProps) {
onFileDialogOpen,
preventDropOnDocument,
useFsAccessApi,
+ getFilesFromEvent,
+ validator,
});
assignRef(openRef, open);