apeman-react-upload

3.1.1 • Public • Published

apeman-react-upload

Build Status Code Climate Code Coverage npm Version JS Standard

apeman react package for file upload components.

Installation

$ npm install apeman-react-upload --save

Demo

Live demo is hosted on GitHub Pages.

Demo Image

Usage

'use strict'
 
import React from 'react'
import {ApUpload, ApUploadStyle} from 'apeman-react-upload'
 
const ExampleComponent = React.createClass({
  render () {
    const s = this
    return (
      <div>
        <ApUploadStyle/>
        <ApUpload multiple={ false }
                  id="demo-file-upload-01"
                  name="file-input-01"
                  accept="image/*"
                  onLoad={ s.handleLoaded }
                  onError={ s.handleError }/>
      </div>
    )
  },
  handleLoaded (urls) {
    console.log('Image urls:', urls)
    /* ... */
  },
  handleError (err) {
    /* ... */
  }
})
 

Components

ApUploadStyle

Props

Name Type Default Description
style object {}
highlightColor string ApStyle.DEFAULT_HIGHLIGHT_COLOR
backgroundColor string ApStyle.DEFAULT_BACKGROUND_COLOR

ApUpload

Props

Name Type Default Description
name string null
id string `ap-upload-${uuid.v4()}`
multiple bool false
onChange func null
onLoad func null
onError func null
width number 180
height number 180
text string 'Upload file'
accept string null
icon string 'fa fa-cloud-upload'
closeIcon string 'fa fa-close'
spinner string
value string array
spinnerIcon ApSpinner.DEFAULT_THEME

License

This software is released under the MIT License.

Links

Package Sidebar

Install

npm i apeman-react-upload

Weekly Downloads

2

Version

3.1.1

License

MIT

Last publish

Collaborators

  • okunishinishi