IDropFileAreaProps
3p-core / IDropFileAreaProps
Interface: IDropFileAreaProps
Props for the DropFileArea component.
Properties
Property | Type | Description |
---|---|---|
allowedTypes? | string [] | Optional list of accepted MIME types for validating uploaded files. Remarks - Accepts values from MimeTypes or custom MIME type strings. - If not provided, all file types are accepted and validation is skipped. - The list is passed to the accept attribute of the file input for browser hints. Default undefined |
error | string | Error message string to display below the drop area. Remarks - Typically used to show validation errors. - Appears in red text if not empty. |
onFileSelected | (file ) => void | Callback function triggered when a file is selected or dropped. Remarks - Called after validation succeeds (if allowedTypes is set). - Called unconditionally if allowedTypes is not provided. |
selectedFile | File | The currently selected file. Remarks - Displayed below the drop area when present. - Passed into the component from external state. |
setError | (msg ) => void | Function to update the error message. Remarks - Used internally to show validation issues to the user. - Clearing the message (null or empty string) hides the error. |