1.0.6 • Published 5 years ago

drop-and-upload v1.0.6

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

React component for drag and drop to upload files

npm version

A plug and play react component to upload files by drag and drop. Files dropped will be returned as Files Array

Demo

How to use?

Install our package through NPM.

npm install drop-and-upload

Add the following code to your React component to import the drop-and-upload component.

    import DropAndUpload from 'drop-and-upload'

and add component to render with callback to get droped files getFiles

    ...
      state={
        files:[],
        uploadLimit:10
      }
      getFiles = (files)=>{
        this.setSate({
          files:files
        });
      }

      render(){
        return <DropAndUpload 
                  getFiles={this.getFiles} 
                  uploadLimit={this.state.uploadLimit}/>
      }
    ...
PropstypeDescription
uploadLimitnumberNumber of images allowed to be uploaded
getFilesfunction()callback passed to component for getting uploaded files

FAQ

I'm not able to see any css

Check if webpack is properly configured. Try importing css import 'drop-and-upload/dist/style.css or you can simply copy css from file in node_modules/drop-and-upload/dist/style.css and use it in your css files

Need any help?

Contact me anytime at vsanse@outlook.com

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago