2.2.2 • Published 2 years ago

@mertsolak/react-drop-zone v2.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

React Drop Zone

Package to upload and convert files with drop zone

npm license size issue

Installation

Use node package manager to install @mertsolak/react-drop-zone.

npm i @mertsolak/react-drop-zone

Basic Usage

import { DropZone, useDropZone } from '@mertsolak/react-drop-zone';

const App = () => {
  // converted files will be available in files array
  // fileInDropZone can be used to style component when any file drag over the drop zone
  // fileList is the original list that comes from event
  // control needs to be given to the component to get updated states
  // 'File' is the default value for the getFilesAs, if it is not provided
  const { files, control, fileList, totalFileSize, errors, fileInDropZone } = useDropZone({
    getFilesAs: 'base64',
  });

  // default components can be overwritten with buttonComponent
  // and contentComponent or container style can be updated via className
  return <DropZone multiple accept={['.png']} control={control} />;
};
2.2.2

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago