Generate forms from JSON object with react
json-obj-form-generator
generate forms from JSON object.
Install
npm install --save json-obj-form-generator
Usage of designer
import { JOFGENDesigner } from 'json-obj-form-generator';
import 'bootstrap/dist/css/bootstrap.css'; // most styles are from bootstrap library
import 'json-obj-form-generator/dist/css/designer.css';
...
render()
{
return (
<JOFGENDesigner
extended={true|false}
json={json}
export={true|false}
onChange={(json, isValid) => { }}
mode={"tree"|"linear"|"linear_merge"}
/>
);
}
...
Usage of generator
import { JOFGENGenerator } from 'json-obj-form-generator';
import 'bootstrap/dist/css/bootstrap.css'; // most styles are from bootstrap library
import 'json-obj-form-generator/dist/css/generator.css';
...
render()
{
return (
<JOFGENGenerator
value={value}
json={json}
onChange={(value, isValid) => { }}
mode={"tree"|"linear"|"linear_merge"}
/>
)
}
...