yagoubi-upload-file
v1.0.5
Published
>
Downloads
3
Readme
yagoubi-upload-file
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