Gathering detailed insights and metrics for @kiocosta/mui-file-dropzone
Gathering detailed insights and metrics for @kiocosta/mui-file-dropzone
Gathering detailed insights and metrics for @kiocosta/mui-file-dropzone
Gathering detailed insights and metrics for @kiocosta/mui-file-dropzone
A Material-UI file-upload dropzone. Written in TypeScript.
npm install @kiocosta/mui-file-dropzone
Typescript
Module System
Node Version
NPM Version
57.9
Supply Chain
91.6
Quality
74.9
Maintenance
100
Vulnerability
100
License
TypeScript (96.26%)
JavaScript (3.74%)
Total Downloads
130
Last Day
1
Last Week
6
Last Month
30
Last Year
123
MIT License
452 Commits
2 Branches
1 Contributors
Updated on Feb 20, 2024
Minified
Minified + Gzipped
Latest Version
4.0.20
Package Id
@kiocosta/mui-file-dropzone@4.0.20
Unpacked Size
193.97 kB
Size
39.68 kB
File Count
57
NPM Version
9.6.7
Node Version
18.17.1
Published on
Mar 04, 2024
Cumulative downloads
Total Downloads
3
5
24
Material-UI-dropzone is a React component using Material-UI and is based on the excellent react-dropzone library.
⚠️ This is a fork from material-ui-dropzone containing a more updated version of
react-dropzone
, which allows for custom validations of files.
This components provide either a file-upload dropzone or a file-upload dropzone inside of a dialog.
The file-upload dropzone features some snazzy "File Allowed/Not Allowed" effects, previews and alerts.
1npm install --save mui-file-dropzone
or
1yarn add mui-file-dropzone
mui-file-dropzone
complies to the following support matrix.
version | React | Material-UI |
---|---|---|
4.x | 17.0+ | 5.x |
3.x | 16.8+ | 4.x |
2.x | 15.x or 16.x | 3.x or 4.x |
This is the Dialog component:
When you drag a file onto the dropzone, you get a neat effect:
And if you drag in a wrong type of file, you'll get yelled at:
N.B. This has some limitations (see here for more details).
See https://yuvaleros.github.io/material-ui-dropzone for Documentation and Examples.
This components creates the dropzone, previews and snackbar notifications without a dialog
1import React, { Component } from "react"; 2import { DropzoneArea } from "mui-file-dropzone"; 3 4class DropzoneAreaExample extends Component { 5 constructor(props) { 6 super(props); 7 this.state = { 8 files: [], 9 }; 10 } 11 handleChange(files) { 12 this.setState({ 13 files: files, 14 }); 15 } 16 render() { 17 return ( 18 <DropzoneArea 19 onChange={this.handleChange.bind(this)} 20 dropzoneProps={{ validator: () => <your custom validation> }} 21 /> 22 ); 23 } 24} 25 26export default DropzoneAreaExample;
This component provides the DropzoneArea inside of a MaterialUI Dialog.
1import React, { Component } from "react"; 2import { DropzoneDialog } from "mui-file-dropzone"; 3import Button from "@mui/material/Button"; 4 5export default class DropzoneDialogExample extends Component { 6 constructor(props) { 7 super(props); 8 this.state = { 9 open: false, 10 files: [], 11 }; 12 } 13 14 handleClose() { 15 this.setState({ 16 open: false, 17 }); 18 } 19 20 handleSave(files) { 21 //Saving files to state for further use and closing Modal. 22 this.setState({ 23 files: files, 24 open: false, 25 }); 26 } 27 28 handleOpen() { 29 this.setState({ 30 open: true, 31 }); 32 } 33 34 render() { 35 return ( 36 <div> 37 <Button onClick={this.handleOpen.bind(this)}>Add Image</Button> 38 <DropzoneDialog 39 open={this.state.open} 40 onSave={this.handleSave.bind(this)} 41 acceptedFiles={["image/jpeg", "image/png", "image/bmp"]} 42 showPreviews={true} 43 maxFileSize={5000000} 44 onClose={this.handleClose.bind(this)} 45 /> 46 </div> 47 ); 48 } 49}
MIT
Thanks goes to these wonderful people (emoji key):
Yuvaleros 🤔 💻 🎨 📖 💬 👀 🚧 | Mattia Panzeri 🤔 💻 🎨 📖 💡 🚇 🐛 💬 👀 🚧 | Max Carroll 🤔 💻 🎨 💡 👀 |
Matthew Corner 🐛 🤔 💻 | Barry Loong 🤔 💻 | JF Blouin 🤔 💻 |
Anthony Raymond 💻 💡 | isaacbuckman 🐛 💻 💡 | MatthijsMud 🐛 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!
No vulnerabilities found.
No security vulnerabilities found.
Last Day
0%
1
Compared to previous day
Last Week
20%
6
Compared to previous week
Last Month
-45.5%
30
Compared to previous month
Last Year
1,657.1%
123
Compared to previous year