Json schema based forms made simple (currently supports React 16.x versions)
Ready forms on NPM
npm i --save ready-forms
Add the below lines to your index.js file
import 'bootstrap/dist/css/bootstrap.min.css';
import "react-datepicker/dist/react-datepicker.css";
Currently there is an error in the build process. So when using this library you'll need to manually also install core-js using the below command :
npm i --save core-js@2
If you face difficulties finding your way around this library I suggest looking at the below How to section.
- Install ready-forms in your React 16.x project
- Find the demo folder in github repo OR in your node_modules => ready-forms folder, download or copy the files from Demo folder into your own project's src folder.
- Now import the Example component in your main component where you want to see the demo app running.
- That's it! you should see a demo form loaded.
- Support for different input types:
- Currency
- DateControl
- Dropdownlist
- Label
- Number
- Percentage
- Radio
- Table - (Note : nested tables are not supported)
- Text
- Website
- Year
- Zipcode
- Support for templates for Form layout and individual control layout - Default implementations of these templates are FormInCardTemplate and BasicFormControlTemplate respectively
- Validations on form elements
- Form state is available on passing setFormState and formState state variables.
- Disabling of fields is available via isDisabled property
- Multiple forms on same page are supported however, please note that separate state variables and json schemas should be used.
- Add pending form controls :
- Button
- FormTooltip
- Custom fields
- Remove dependency on bootstrap, reactstrap - no default styling
- Remove dependency on availity input controls - implement validation logic to remove this dependency
- Easy schema creation tool
- Get form's and individual control's validity statuses
- Support reflection of one field's value in another non-related field in the same form (use-case : password and confirm password)
- Custom hooks when updating values
- Adding and Removing of new rows from Table
- Toolbar elements for table type (for table action buttons)
- Allow updating any property on a field - dynamic field labels to be made possible.
- Differentiating optional fields by default - user should be able to override this behaviour.
- Code cleanup and making better use of Typescript
- Currency, Number, Year, Zipcode - currently all these work the same way. Need to have correct behaviours assigned as per the field type (for now the number field can be used in replacement for any of these)
Ready-forms currently depends upon availity-reactstrap-validation, bootstrap, react-datepicker and reactstrap libraries which will get installed automatically when ready-forms is installed. If any of these libraries are not installed you can run this command to install all dependencies :
npm i availity-reactstrap-validation bootstrap react-datepicker reactstrap