react-file-input

WebJar for react-file-input

License

License

MIT
Categories

Categories

React User Interface Web Frameworks
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

react-file-input
Last Version

Last Version

0.2.5
Release Date

Release Date

Type

Type

jar
Description

Description

react-file-input
WebJar for react-file-input
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/captivationsoftware/react-file-input

Download react-file-input

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/react-file-input/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>react-file-input</artifactId>
    <version>0.2.5</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/react-file-input/
implementation 'org.webjars.npm:react-file-input:0.2.5'
// https://jarcasting.com/artifacts/org.webjars.npm/react-file-input/
implementation ("org.webjars.npm:react-file-input:0.2.5")
'org.webjars.npm:react-file-input:jar:0.2.5'
<dependency org="org.webjars.npm" name="react-file-input" rev="0.2.5">
  <artifact name="react-file-input" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='react-file-input', version='0.2.5')
)
libraryDependencies += "org.webjars.npm" % "react-file-input" % "0.2.5"
[org.webjars.npm/react-file-input "0.2.5"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

react-file-input

Demo

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

npm install react-file-input

Code Example

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

app.jsx

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

org.webjars.npm

Captivation Software

Versions

Version
0.2.5