React Dropzone based Material UI file upload component for React.js. This is created for Material UI v5 or later versions.
Written in Typescript. Library exports commonjs
and esm
modules.
yarn add react-material-file-upload
- Peer dependencies.
Library is depends on @mui/material
, @mui/icons-material
, @emotion/react
, @emotion/styled
. These are Material UI dependencies. Please refer the Material UI guide on configuring it.
import { useState } from 'react';
import FileUpload from 'react-material-file-upload';
const App = () => {
const [files, setFiles] = useState<File[]>([]);
return <FileUpload value={files} onChange={setFiles} />;
};