Dropzone

Demo

Props

PropTypeDescription
titlestringThe title displayed inside the dropzone area.
descriptionstring (optional)A description or instructions displayed inside the dropzone.
iconLucideIcon (optional)A custom icon to display inside the dropzone area.
acceptAccept (optional)File type restrictions for the dropzone.
maxFilesnumber (optional)The maximum number of files allowed in the dropzone.
onChanges(files?: File[]) => void (optional)Callback function when files are added or removed.
classNames{ root?: string; dropzone?: string; fileitem?: string } (optional)Custom class names for the dropzone and file item components.

Styles

This component allows for custom styles via the classNames prop:

  • root: CSS class for styling the overall Dropzone component.
  • dropzone: CSS class for styling the dropzone area.
  • fileitem: CSS class for styling the file item list.

Functionality

  • Supports file drag-and-drop, as well as file selection.
  • Displays custom icons and file size information.
  • Users can remove files from the list.
  • Customizable to restrict file types and limit the number of files.