|
1 | | -# react-mui-fileuploader |
| 1 | +<p align="center"><a href="" target="_blank"><img align="center" src="public/preview.png"></a></p> |
| 2 | + |
| 3 | + |
| 4 | +<h1 align="center">🗃️ React Material Fileuploader</h1> |
| 5 | +<p align="center">developed with <a target="_blank" href="https://mui.com">@mui v5</a> </p> |
| 6 | + |
| 7 | +<p align="center"> |
| 8 | + <img alt="MIT license" src="https://img.shields.io/badge/license-MIT-blue.svg"> |
| 9 | + <img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/rouftom/react-mui-fileuploader"> |
| 10 | + <img alt="GitHub code size in bytes" src="https://img.shields.io/github/languages/code-size/rouftom/react-mui-fileuploader"> |
| 11 | + <img alt="Snyk Vulnerabilities for GitHub Repo" src="https://img.shields.io/snyk/vulnerabilities/github/rouftom/react-mui-fileuploader"> |
| 12 | +</p> |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +React mui fileuploader is a react component based on @mui v5 that allows you to upload files with an awesome ui component. |
| 17 | + |
| 18 | + |
| 19 | +## 🚀 Installation |
| 20 | +```nodejs |
| 21 | + npm install react-mui-fileuploader |
| 22 | +``` |
| 23 | + |
| 24 | +## 💻 Usage |
| 25 | +```javascript |
| 26 | +import React from 'react' |
| 27 | +import ReactDOM from 'react-dom' |
| 28 | +import Scheduler from "react-mui-fileuploader" |
| 29 | + |
| 30 | +function App() { |
| 31 | + |
| 32 | + const handleFileUploadError = (error) => { |
| 33 | + // Do something... |
| 34 | + } |
| 35 | + |
| 36 | + const handleFilesChange = (files) => { |
| 37 | + // Do something... |
| 38 | + } |
| 39 | + |
| 40 | + return ( |
| 41 | + <FileUpload |
| 42 | + multiFile={true} |
| 43 | + disabled={false} |
| 44 | + title="My awesome file uploader" |
| 45 | + header="[Drag to drop]" |
| 46 | + leftLabel="or" |
| 47 | + rightLabel="to select files" |
| 48 | + buttonLabel="click here" |
| 49 | + options={{ |
| 50 | + multiFile: true, |
| 51 | + maxFileSize: 5, |
| 52 | + maxUploadFiles: 0, |
| 53 | + filesContainerHeight: 357, |
| 54 | + maxFilesContainerHeight: 357, |
| 55 | + imageSrc: '', |
| 56 | + allowedExtensions: ['jpg', 'jpeg'], |
| 57 | + }} |
| 58 | + maxFileSize={10} |
| 59 | + maxUploadFiles={0} |
| 60 | + maxFilesContainerHeight={357} |
| 61 | + errorSizeMessage={'fill it or move it to use the default error message'} |
| 62 | + allowedExtensions={['jpg', 'jpeg']} |
| 63 | + onFilesChange={handleFilesChange} |
| 64 | + onError={handleFileUploadError} |
| 65 | + imageSrc={'path/to/custom/image'} |
| 66 | + bannerProps={{ elevation: 0, variant: "outlined" }} |
| 67 | + containerProps={{ elevation: 0, variant: "outlined" }} |
| 68 | + /> |
| 69 | + ) |
| 70 | +} |
| 71 | + |
| 72 | +ReactDOM.render(<App />, document.querySelector('#root')) |
| 73 | + |
| 74 | +``` |
| 75 | + |
| 76 | + |
| 77 | +## 😁 Authors |
| 78 | + |
| 79 | +- Muller Roufaou ([rouftom](http://github.com/rouftom)) |
| 80 | + |
| 81 | + |
| 82 | +## 🤔 FAQ |
| 83 | + |
| 84 | +* __Where can I find more documentation?__ |
| 85 | + |
| 86 | + This library is a marriage of [@mui](http://mui.com/getting-started/usage/) and a React setup created with [React](https://fr.reactjs.org/). Either one would be a great place to start! |
| 87 | + |
| 88 | + |
| 89 | +## 🙇♂️ Extra |
| 90 | + |
| 91 | + Do you like this library ? Buy me a coffee or support me with a star on Github |
| 92 | + |
| 93 | +* Btc address: `bc1qettgagenn9nc8ks7ghntjfme96yvvkfhntk774` |
| 94 | + |
| 95 | +* Eth address: `0xB0413d8D0336E263e289A915c383e152155881E0` |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | +## License |
| 100 | + |
| 101 | +### react-mui-fileuploader |
| 102 | + |
| 103 | +MIT License |
| 104 | + |
| 105 | +Copyright (c) 2021 rouftom |
| 106 | + |
| 107 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 108 | +of this software and associated documentation files (the "Software"), to deal |
| 109 | +in the Software without restriction, including without limitation the rights |
| 110 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 111 | +copies of the Software, and to permit persons to whom the Software is |
| 112 | +furnished to do so, subject to the following conditions: |
| 113 | + |
| 114 | +The above copyright notice and this permission notice shall be included in all |
| 115 | +copies or substantial portions of the Software. |
| 116 | + |
| 117 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 118 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 119 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 120 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 121 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 122 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 123 | +SOFTWARE. |
0 commit comments