Skip to content

Marlond25/easy-reactstrap-form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is a Reactjs component meant to be used within an application for building forms easyly.

INSTALATION

npm i easy-reactstrap-form

USE

In your wrapping component, import the ezform component:

import EasyForm from 'EasyForm.js'

STATE

Create a state as follows:

const [formData, setFormData] = useState({});

const selectSet = { form1: setFormData, };

FIELDS

Ezform recieves an Array of fields with its properties:

const fields = [ { type: 'email', name: 'email', id: 'exampleEmail', label: 'Email' }, { type: 'password', name: 'password', id: 'examplePassword', label: 'Password' }, { type: 'select', name: 'select', id: 'exampleSelect', label: 'Select', options: [ 1, 2, 3, 4, 5 ] }, { type: 'textarea', name: 'text', id: 'exampleText', label: 'Text Area' } ];

IMPLEMENTATION

Implement the component as follows:

""