1.0.5 • Published 5 years ago

yagoubi-upload-file v1.0.5

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

yagoubi-upload-file

NPM JavaScript Style Guide

Demo

yagoubi-upload-file

Install

npm install --save yagoubi-upload-file

Usage

import React, { Component } from 'react'

import UploadFile from 'yagoubi-upload-file'

class Example extends Component {

  onError = error => {
    console.log(error);
  }
 onChange = files => {
    console.log(files);
  }
  render () {
    return (
      <UploadFile
        onError={this.onError}
        onChange={this.onChange}
      />
    )
  }
}

props

All props are not require
propstypedescription
labelstringthe label that should diplay in upload button
acceptsarray of stringarray of accepted type of file 'image/png', '.pdf', 'audio/*', ...
multipleboolenmultifile or not
maxFilesnumberif multiple you can add the maximum of number of files
maxFileSizenumbermaximum file size
minFileSizenumberminimum file size
colorstringthe color of the upload button
onErrormethodexecuting when an error happen
onChangemethodexecuting when file uploaded

License

MIT © yagoubi abdelkader

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago