Skip to main content
Version: 2.1.4

IDropFileAreaProps

3p-core v2.1.4


3p-core / IDropFileAreaProps

Interface: IDropFileAreaProps

Props for the DropFileArea component.

Properties

PropertyTypeDescription
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
errorstringError message string to display below the drop area. Remarks - Typically used to show validation errors. - Appears in red text if not empty.
onFileSelected(file) => voidCallback 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.
selectedFileFileThe currently selected file. Remarks - Displayed below the drop area when present. - Passed into the component from external state.
setError(msg) => voidFunction 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.