Skip to main content

IDropFileAreaProps

@spartanfx/react v1.2.2


@spartanfx/react / index / IDropFileAreaProps

Interface: IDropFileAreaProps

Props for the DropFileArea component.

Properties

Required

PropertyTypeDescription
errorstringError message string to display below the drop area.
onChange(files) => voidCallback function triggered when a file is selected or dropped.
selectedFilesFile[]The currently selected file.
setError(msg) => voidFunction to update the error message.

Options

PropertyTypeDescription
allowedTypes?MimeTypes[]Optional list of accepted MIME types for validating uploaded files. If not provided, all file types are accepted.
disabled?booleanWhether the component is disabled.
helperText?stringOptional helper text displayed below the main label.
label?stringOptional custom label for the drop area.
maxFiles?numberOptional cap (mainly useful in multiple mode).
multiple?booleanIf false/undefined, keeps at most 1 file (still returns File[]).

Appearance & theming

PropertyTypeDescription
appearance?AppearanceModeExplicit appearance control. - auto (default): follow Fluent UI theme - light: force light mode - dark: force dark mode