Flexibile and extendable form builder with constructor
MIT License
Flexible Form (fform
) - form builder with minimum redundancy, maximum flexibility, and extendability. It uses JSONSchema to describe forms, React (v16) for rendering and has native Redux support for state storage but can be used with any other external storage or can use only internal storage (storage agnostic).
See fform-constructor for live demo.
allOf
, oneOf
, $ref
propertiesTo install the stable version:
npm install --save fform
This assumes that you are using npm with a module bundler like webpack
import {FForm, elements} from 'fform';
import {render} from 'react-dom';
render(<FForm core={{name:"name", schema: {type:"string"}, elements}}/>, document.querySelector('#root'));
import {FForm, elements} from 'fform';
import {render} from 'react-dom';
import imjvWrapper from 'fform/addons/imjvWrapper';
import * as imjvValidator from 'fform/addons/is-my-json-valid-lite';
const JSONValidator = imjvWrapper(imjvValidator);
render(<FForm core={{name:"name", schema: {type:"string"}, elements, JSONValidator}}/>,
document.querySelector('#root'));
How to use with different storages see in documentation
get(...paths: string | string[]
)set(path: string | string[], value: any, opts?: setOpts )
getValue(opts?: getValueOpts)
setValue(value: any, opts?: setValueOpts)
getDefaultValue()
reset(opts?: resetOpts)
clear(opts?: clearOpts)
validate(path: boolean | string | string[], opts?: APIOptsType)
arrayAdd(path: string | string[], value: number | any[], opts?: APIOptsType)
arrayItemOps(path: string | string[], op: string, opts: arrayItemOpts)
setHidden(path: string | string[], value?: boolean, opts?: APIOptsType)
showOnly(path: string | string[], opts?: APIOptsType)
getActive()
execute()
_placeholder?: string
_params?: FFParamsType
_data?: any
_presets?: string
_simple?: boolean
_enumExten?: { [key: string]: undefined | string | object }
_stateMaps?: Array
_validators?: Array
_oneOfSelector: string | dataHandler
_custom?: FFCustomizeType
_layout?: FFLayoutCustomizeType
_strictLayout?: boolean