# react-file-input

> Simple file input component for React

Latest version **0.2.5** (published 2015-09-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-file-input
pnpm add react-file-input
yarn add react-file-input
bun add react-file-input
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.5 |
| Published | 2015-09-25 |
| First published | 2015-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/react-file-input) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 82 |
| Author | Captivation Software |
| Maintainers | dbarbalato |
| Keywords | react, react-component, upload, file, input |

## Links

- npm: https://www.npmjs.com/package/react-file-input
- Repository: https://github.com/captivationsoftware/react-file-input
- Issues: https://github.com/captivationsoftware/react-file-input/issues
- npm.io page: https://npm.io/package/react-file-input

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.2.5 (latest) — 2015-09-25
- 0.2.4 — 2015-07-18
- 0.2.3 — 2015-07-18
- 0.2.2 — 2015-07-18
- 0.2.1 — 2015-07-18
- 0.2.0 — 2015-07-12
- 0.1.8 — 2015-06-24
- 0.1.7 — 2015-04-27
- 0.1.6 — 2015-04-27
- 0.1.5 — 2015-04-26
- 0.1.4 — 2015-04-26
- 0.1.3 — 2015-04-26
- 0.1.2 — 2015-04-22
- 0.1.1 — 2015-04-22
- 0.1.0 — 2015-04-22
- … 2 more at https://npm.io/package/react-file-input/versions

## README

react-file-input
============
[Demo](https://captivationsoftware.github.io/react-file-input)

Styling native HTML file inputs can be a pretty big pain, and to make matters worse, the browser default look-and-feel is probably at odds with your app's design. This problem is what react-file-input aims to solve.

Once integrated, react-file-input quickly eliminates the headaches associated with forms requiring file upload.

## Installation
```sh
npm install react-file-input
```

## Code Example
Usage is pretty simple: just use react-file-input instead of `<input type="file" />`!

app.jsx
```js
var React = require('react'),
  FileInput = require('react-file-input');

var Form = React.createClass({
  handleChange: function(event) {
    console.log('Selected file:', event.target.files[0]);
  },

  render: function() {
    return (
      <form>
        <FileInput name="myImage"
                   accept=".png,.gif"
                   placeholder="My Image"
                   className="inputClass"
                   onChange={this.handleChange} />
      </form>
    );
  },
});

```

The list of valid props can be found below.

### Props

#### name, accept, className, placeholder, onChange
Behave just like standard react-style attributes on input controls.

## Contributors

Captivation Software (@teamcaptivation)

By all means, if you see room for improvement, let us know!


## License

MIT License

---
_Source: https://npm.io/package/react-file-input · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
