developed with @mui v5
React mui fileuploader is a react component based on @mui v5 that allows you to upload files with an awesome ui component.
npm install react-mui-fileuploader
import React from 'react'
import ReactDOM from 'react-dom'
import FileUpload from "react-mui-fileuploader"
function App() {
const handleFileUploadError = (error) => {
// Do something...
}
const handleFilesChange = (files) => {
// Do something...
}
return (
<FileUpload
multiFile={true}
disabled={false}
title="My awesome file uploader"
header="[Drag to drop]"
leftLabel="or"
rightLabel="to select files"
buttonLabel="click here"
buttonRemoveLabel="Remove all"
maxFileSize={10}
maxUploadFiles={0}
maxFilesContainerHeight={357}
errorSizeMessage={'fill it or move it to use the default error message'}
allowedExtensions={['jpg', 'jpeg']}
onFilesChange={handleFilesChange}
onError={handleFileUploadError}
imageSrc={'path/to/custom/image'}
bannerProps={{ elevation: 0, variant: "outlined" }}
containerProps={{ elevation: 0, variant: "outlined" }}
/>
)
}
ReactDOM.render(<App />, document.querySelector('#root'))
- Muller Roufaou (rouftom)
-
Where can I find more documentation?
This library is a marriage of @mui and a React setup created with React. Either one would be a great place to start!
Do you like this library ? Buy me a coffee or support me with a star on Github
-
Btc address:
bc1qettgagenn9nc8ks7ghntjfme96yvvkfhntk774
-
Eth address:
0xB0413d8D0336E263e289A915c383e152155881E0
MIT License
Copyright (c) 2022 rouftom
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.