@pikas-ui/dropzone

This package contains a dropzone component. that allows you to drag and drop files.

This library is based on react-dropzone.

Change Log

Requirements

To use this package, you must install the @pikas-ui/styles package.

Installation

You can install this package using npm, yarn, or pnpm.

npm install @pikas-ui/dropzone
yarn add @pikas-ui/dropzone
pnpm add @pikas-ui/dropzone

Usage

Dropzone

The dropzone component allows you to drag and drop files. It also allows you to select files using the file dialog.

import { Dropzone } from '@pikas-ui/dropzone';

const Example: React.FC = () => {
  return <Dropzone />;
};

Props

PropDescriptionTypeDefault
heightThe height of the dropzonenumber or string200
widthThe width of the dropzonenumber or string"100%"
descriptionThe description of the dropzonestring-
subDescriptionThe sub description of the dropzonestring-
cssThe css of the dropzoneDropzoneCSS-
showFilesResultShow the files resultbooleantrue
maxFilesThe max files of the dropzone (0 for unlimited)number0
acceptSet the accepted file typesstring-
maxSizeSet the max size of the filenumberInfinity
minSizeSet the min size of the filenumber0
disabledDisable the dropzonebooleanfalse
multipleAllow multiple filesbooleantrue
noClickDisable click to open file dialogbooleanfalse
noKeyboardDisable keyboard navigationbooleanfalse
autoFocusSet focus on the dropzonebooleanfalse
getFilesFromEventGet files from eventFunction-
noDragEventsBubblingStop drag events from bubblingbooleanfalse
onDropCallback when a file is droppedFunction-
onDropAcceptedCallback when a file is acceptedFunction-
onDropRejectedCallback when a file is rejectedFunction-
onDragEnterCallback when the dragenter event occursFunction-
onDragLeaveCallback when the dragleave event occursFunction-
onDragOverCallback when the dragover event occursFunction-
noDragDisable drag and dropbooleanfalse
onErrorCallback when an error occursFunction-
onFileDialogCancelCallback when the file dialog is canceledFunction-
onFileDialogOpenCallback when the file dialog is openedFunction-
preventDropOnDocumentPrevent drop on documentbooleanfalse
useFsAccessApiUse the file system access apibooleanfalse
validatorValidator functionFunction-

Contributing

This documentation can be edited on GitHub here