json-as-form
v0.0.22
Published
Edit JSON as a form
Downloads
89
Readme
Live Demo
https://codesandbox.io/s/json-as-form-demo-2si2l
Usage
import JSONForm from "json-as-form";
<JSONForm
json={plainJsonObjORArray}
onChange={data => console.log(data)}
autoAddRow={true}
debug={false}
rowInterpolator={row=> {
if(row.value) row.value = row.value.toLowerCase()
return row
}}
/>
Props
|name | required | defaultvalue | description |
|-- | -- | -- |--|
| json | yes | | {}, []
plain JSON object or form state |
| onChange | yes | fn | get form state in callback based on json
prop type|
| fixedKeys | no | [] | enum[ "key", "value"], non editable fields|
| autoAddRow | no | false | auto add new row |
| debug | no | false | if true
then It'll print state |
| rowInterpolator | no | row=> row | interpolate the row data before onChange
callback|
LICENSE
MIT @Firecamp