React file dropzone and uploader
Installations
npm install @vizualabstract/react-dropzone-uploader
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
16.15.0
NPM Version
8.5.5
Score
66.7
Supply Chain
94
Quality
74.9
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (64.21%)
JavaScript (25.46%)
CSS (4.71%)
HTML (2.66%)
Python (2.53%)
Shell (0.43%)
Developer
Download Statistics
Total Downloads
36,348
Last Day
2
Last Week
4
Last Month
15
Last Year
73
GitHub Statistics
247 Commits
1 Forks
1 Watching
13 Branches
1 Contributors
Bundle Size
43.97 kB
Minified
13.56 kB
Minified + Gzipped
Package Meta Information
Latest Version
2.24.0
Package Id
@vizualabstract/react-dropzone-uploader@2.24.0
Unpacked Size
138.15 kB
Size
39.06 kB
File Count
17
NPM Version
8.5.5
Node Version
16.15.0
Total Downloads
Cumulative downloads
Total Downloads
36,348
Last day
0%
2
Compared to previous day
Last week
-33.3%
4
Compared to previous week
Last month
650%
15
Compared to previous month
Last year
-99.6%
73
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Peer Dependencies
3
Dev Dependencies
33
React Dropzone Uploader
React Dropzone Uploader is a customizable file dropzone and uploader for React.
Features
- Detailed file metadata and previews, especially for image, video and audio files
- Upload status and progress, upload cancellation and restart
- Easily set auth headers and additional upload fields (see S3 examples)
- Customize styles using CSS or JS
- Take full control of rendering with component injection props
- Take control of upload lifecycle
- Modular design; use as standalone dropzone, file input, or file uploader
- Cross-browser support, mobile friendly, including direct uploads from camera
- Lightweight and fast
- Excellent TypeScript definitions
Documentation
https://react-dropzone-uploader.js.org
Installation
npm install --save react-dropzone-uploader
Import default styles in your app.
1import 'react-dropzone-uploader/dist/styles.css'
Quick Start
RDU handles common use cases with almost no config. The following code gives you a dropzone and clickable file input that accepts image, audio and video files. It uploads files to https://httpbin.org/post
, and renders a button to submit files that are done uploading. Check out a live demo.
1import 'react-dropzone-uploader/dist/styles.css' 2import Dropzone from 'react-dropzone-uploader' 3 4const MyUploader = () => { 5 // specify upload params and url for your files 6 const getUploadParams = ({ meta }) => { return { url: 'https://httpbin.org/post' } } 7 8 // called every time a file's `status` changes 9 const handleChangeStatus = ({ meta, file }, status) => { console.log(status, meta, file) } 10 11 // receives array of files that are done uploading when submit button is clicked 12 const handleSubmit = (files) => { console.log(files.map(f => f.meta)) } 13 14 return ( 15 <Dropzone 16 getUploadParams={getUploadParams} 17 onChangeStatus={handleChangeStatus} 18 onSubmit={handleSubmit} 19 accept="image/*,audio/*,video/*" 20 /> 21 ) 22}
Examples
See more live examples here: https://react-dropzone-uploader.js.org/docs/examples.
Props
Check out the full table of RDU's props.
Browser Support
Chrome | Firefox | Edge | Safari | IE | iOS Safari | Chrome for Android |
---|---|---|---|---|---|---|
✔ | ✔ | ✔ | 10+, 9* | 11* | ✔ | ✔ |
* requires Promise
polyfill, e.g. @babel/polyfill
UMD Build
This library is available as an ES Module at https://unpkg.com/react-dropzone-uploader@VERSION/dist/react-dropzone-uploader.umd.js.
If you want to include it in your page, you need to include the dependencies and CSS as well.
1<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.4.2/umd/react.production.min.js"></script> 2<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.4.2/umd/react-dom.production.min.js"></script> 3<script src="https://cdnjs.cloudflare.com/ajax/libs/prop-types/15.6.2/prop-types.min.js"></script> 4 5<script src="https://unpkg.com/react-dropzone-uploader@VERSION/dist/react-dropzone-uploader.umd.js"></script> 6<link rel"stylesheet" href="https://unpkg.com/react-dropzone-uploader@VERSION/dist/styles.css"></script>
Contributing
There are a number of places RDU could be improved; see here.
For example, RDU has solid core functionality, but has a minimalist look and feel. It would be more beginner-friendly with a larger variety of built-in components.
Shout Outs
Thanks to @nchen63 for helping with TypeScript defs!
Running Dev
Clone the project, install dependencies, and run the dev server.
1git clone git://github.com/fortana-co/react-dropzone-uploader.git 2cd react-dropzone-uploader 3yarn 4npm run dev
This runs code in examples/src/index.js
, which has many examples that use Dropzone
. The library source code is in the /src
directory.
Thanks
Thanks to react-dropzone
, react-select
, and redux-form
for inspiration.
No vulnerabilities found.
No security vulnerabilities found.
Gathering detailed insights and metrics for @vizualabstract/react-dropzone-uploader