react-lite-uploader
v0.3.2
Published
Uploader plugin menu from Talk by teambition
Downloads
10
Readme
React Lite Uploader
This project is no mature, do not use it in production!
Uploader component from Talk by Teambition.
Demo http://ui.talk.ai/react-lite-uploader
Based on the work of https://github.com/mailru/FileAPI
Supposition
Contains internal business logic defined at Talk by Teambition.
Usage
npm i --save react-lite-uploader
UploadButton = require('react-lite-uploader').Button
UploadArea = require('react-lite-uploader').Area
uploadUtil = require('react-lite-uploader').util
UploadButton
, UploadArea
: React Components
props:
url
, string, server url to upload files, requiredheaders
, object of headers, optionalaccept
, string of accepted types, seperated by commas likejpg,png
, optional, defaults to''
multiple
, bool, optional, defaults tofalse
onFileHover
, function to response to dragging files, optional(only used handling dropping files)onCreate
, function, optionalonProgress
, function, optionalonSuccess
, function, requiredonError
, function, required
Notice: UploadArea
is not suggested due to the lack of flexibility, use uploadUtil
instead.
uploadUtil
: utilities to handle dropping and pasting
uploadUtil.handleFileDropping
(event, props) ->
uploadUtil.handlePasteEvent
(targetElement, props) ->
uploadUtil.onFilesLoad
(files, props) ->
Remember to include react-lite-uploader/src/styles.css
in you project.
Read page.coffee
for details.
Develop
Based on Jianliao's project template:
https://github.com/teambition/coffee-webpack-starter
License
MIT