/react-input-files

Reusable React input file component.

Primary LanguageJavaScriptMIT LicenseMIT

react-input-files

Reusable React input file component.

Travis Codecov Status npm package npm downloads

Dependency Status devDependency Status peerDependency Status

prettier license

Installation

$ yarn add react-input-files

Demo

Usage

import InputFiles from 'react-input-files';

<InputFiles onChange={files => console.log(files)}>
  <button>Upload</button>
</InputFiles>;

API

type Props = {
  children: React.Node,
  onChange: (files: Array<Object>, e: SyntheticEvent<HTMLInputElement>) => void,
  accept?: string,
  style?: Object,
};

Development

Requirements

  • node >= 9.4.0
  • yarn >= 1.3.2
$ yarn install --pure-lockfile
$ yarn start

Test

$ yarn run format
$ yarn run eslint
$ yarn run flow
$ yarn run test:watch
$ yarn run build

CONTRIBUTING

  • ⇄ Pull requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.
  • Pull requests must be accompanied by passing automated tests.

CHANGELOG

LICENSE

MIT: http://michaelhsu.mit-license.org