Skip to content
This repository was archived by the owner on Jul 9, 2019. It is now read-only.
/ react-form-helper Public archive

React component for building forms with ease

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

beanloop/react-form-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2a4516d · May 9, 2017

History

41 Commits
Mar 17, 2017
Mar 16, 2017
Mar 16, 2017
Dec 13, 2016
Dec 13, 2016
Jan 10, 2017
Dec 13, 2016
Dec 13, 2016
Dec 13, 2016
Mar 9, 2017
May 9, 2017
Mar 16, 2017
Dec 13, 2016
May 9, 2017

Repository files navigation

react-form-helper

Build Status npm version License

React component for building forms with ease.

Install

yarn add react-form-helper
npm install --save react-form-helper

Usage

react-form-helper accept custom components for form, input and button, which makes it easy to use with libraries such as react-toolbox and react-mdl.

Example below shows a simple usage using react-toolbox:

import {FormHelper} from 'react-form-helper'
import Button from 'react-toolbox/lib/button'
import Checkbox from 'react-toolbox/lib/checkbox'
import Input from 'react-toolbox/lib/input'

const SignIn = () =>
  <FormHelper
    saveButton='Login'
    inputComponent={Input}
    buttonComponent={Button}
    onSave={credentials => signIn(dispatch, credentials)}
    object={{}}
    fields={[
      {path: ['email'], icon: 'email', label: 'Email', type: 'email'},
      {path: ['password'], icon: 'lock', label: 'Password', type: 'password'},
      {path: ['rememberMe'], component: ({value, onChange}) => (
        <Checkbox
          label='Remember me'
          checked={!!value}
          onChange={onChange}
        />
      )},
    ]}
  />
)

Docs

Exampels can be found here. API docs can be found as doc comments in the code.

License

react-form-helper is dual-licensed under Apache 2.0 and MIT terms.