Skip to content
This repository has been archived by the owner on Sep 6, 2020. It is now read-only.

mhnpd/simple-react-file-uploader

Repository files navigation

Simple React File Uploader

Maintainability

Simple React File Uploader is a react component for uploading multiple or single file.

title

New Features!

  • Support drag and drop.
  • Single or multiple files.

This component will only take a multiple file or single file from UI component and return a array 'onChange' event.

Installation

$ npm i --save simple-react-file-uploader

Use

import FileInput from 'simple-react-file-uploader';

export default class componentName extends Component {
render() {
    return (
    <FileInput 
      multiple={true}
      onChange = {this.handleChange}
      accept="image/*"
    />
        )
    }
}

Props and description

Props Required/Optional Description
onChange required props accepts a function. Function is called when file are added or removed.
multiple optional Props accepts boolean value. If true multiple files are accepted else single file accepted. By default its false.
accept optional Provide a accepted file type list.
className optional this props is used to pass a className to a parent div of component.

Development

Todos

  • passing style
  • passing icon and icon type
  • layout props

License

MIT