1.0.1 • Published 5 years ago

react-tera-forms v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

react-forms

Forms for React

NPM JavaScript Style Guide

Install

npm install --save react-tera-forms

Usage

import React, { Component } from 'react'

import Form, { Validators } from 'react-tera-forms'

class Example extends Component {
  render () {
    return (
      <Form
        name='My Form'
        onSubmit={this.onSubmit}
        config={{
          fields: {
            name: 'text',
            place: {
              type: 'text',
              validators: Validators.REQUIRED,
            },
            number: {
              type: 'text',
              validators: [
                Validators.REQUIRED,
                Validators.NUMBER,
              ],
            },
            home: {
              type: 'text',
              validators: [
                Validators.REQUIRED,
              ],
              renderInput: ({value, onChange}) => (
                <textarea name='Home' value={value} onChange={(event) => onChange('home', event.target.value)} />
              ),
            },
          },
        }}
      />
    )
  }
}

License

MIT © csalajan

1.0.1

5 years ago

1.0.0

5 years ago