Skip to content

izikorgad/react-stateful-forms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-stateful-forms

npm version npm downloads

React Stateful Forms Library.

Install

$ npm install react-stateful-forms --save

Features

  • React Form component infrastructure.
  • No redux/flux required.
  • Built-in custom validation error.

Usage

import { Form, Field } from "react-stateful-forms";

  render() {
      ...

        <Form onSubmit={ this.submitMyForm } name="test_form" header="My Test Form">

          <Field title="Name"
            value="John Doe"
            name="name"
            disabled={ false }
            validator={ (value) => { if (value === "John Doe") return "Please change default value"; return undefined; } }
            required inputType="text" />

          <Field title="Male"
            value="male"
            name="gender"
            inputType="radio" />

          <Field title="Female"
            value="female"
            name="gender"
            inputType="radio" />

          <Field title="Subscribe"
            name="subscribe"
            value={ false }
            required
            inputType="checkbox" />

        </Form>
    ...
}

About

React Stateful Forms Library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published