react-fileprompt
v0.1.1
Published
React component for prompting user for a file
Downloads
11
Readme
react-fileprompt
A wrapper component for creating buttons / links / whatever clickable that propmt for files
Installation
npm install react-fileprompt
Usage
var FilePrompt = require('react-fileprompt')
React = require('react');
var filesSelected = function(files) {
// files is an instance of FileList
for (var i = 0; i < files.length; i++) {
console.log(files[i].name);
}
};
React.renderComponent(<FilePrompt onFilesSelected={filesSelected}><button>Click me to prompt for files</button></FilePrompt>, document.body);
You can set multiple
prop for FilePrompt
to prompt for multiple files.
Author
Niklas Närhinen [email protected]
License
The MIT license