form-fields-react

1.1.2 • Public • Published

Form-Fields-React

Form Fields React rendering engine

Form-Fields-React is a component that easily lets you render form fields into rows and column which you can drop it into your existing project.

It's a plug and play component that'll fit in your workflow if your using standalone React/Formik/Redux-Form.

It also gives you the benefit of rendering form fields conditional as seen in this example.

Features include

  • Rendering form fields conditionally
  • Rendering form fields in rows and columns

Check out this sandbox example for more usage

Installation and usage

yarn add form-fields-react
import React from 'react';
import { FormFields } from 'form-fields-react';
 
const fields = [
  {
    type: 'text',
    name: 'firstName',
    component: TextField,
    placeholder: 'First Name',
    value: 'John'
  },
  {
    type: 'text',
    name: 'lastName',
    component: TextField,
    placeholder: 'Last Name',
    value: 'Doe'
  }
];
 
const Form = () => (
  <form>
    <FormFields fields={fields} />
  </form>
);

Props

  • fields - specify the fields that needs to be rendered

Package Sidebar

Install

npm i form-fields-react

Weekly Downloads

2

Version

1.1.2

License

MIT

Unpacked Size

10.3 kB

Total Files

7

Last publish

Collaborators

  • ayoola-solomon