yagoubi-upload-file

1.0.5 • Public • Published

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
props type description
label string the label that should diplay in upload button
accepts array of string array of accepted type of file ['image/png', '.pdf', 'audio/*', ...]
multiple boolen multifile or not
maxFiles number if multiple you can add the maximum of number of files
maxFileSize number maximum file size
minFileSize number minimum file size
color string the color of the upload button
onError method executing when an error happen
onChange method executing when file uploaded

License

MIT © yagoubi abdelkader

Readme

Keywords

none

Package Sidebar

Install

npm i yagoubi-upload-file

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

87 kB

Total Files

6

Last publish

Collaborators

  • yagoubi