Deprecation Notice
This package demonstrates the feasibility of implementing JSONForms with inferno. Since this is mostly a prototype and is no longer maintained, we would like to recommend using JSONForms 2+ to you.
Please check out jsonforms.io for more information. Users of JSONForms 1 may want to also take a look at the migration guide.
JSONForms - More Forms. Less Code
Complex Forms in the blink of an eye
JSONForms uses HTML custom elements and eliminates the need to write HTML templates in order to create forms by leveraging the capabilities of JSON and JSON schema.
Usage
JSONForms is based on Custom elements,
which are not yet supported by all browsers, hence you'll need to include additional files in order to enable Custom Elements support:
These files are webcomponents-lite.js
and native-shim.js
as well as JSONForms itself via jsonforms.js
.
Pay attention to the order when including these files.
Once you add a json-forms
element to the DOM with at least a data
attribute set,
a form will be rendered for you.
Data and UI schemas can be configured by the dataSchema
and uiSchema
attributes.
Use CSS to style the form however you want.
Step by Step Example Usage
- Install JSONForms via
npm install jsonforms@next
- Add
webcomponents-lite.js
,native-shim.js
,jsonforms.js
andjsonforms-example.css
to your HTML
- Add Javascript to create a
json-forms
element:
The whole document may for example now look like this:
- Optional: Add you own Data and UI schema within the script
Developers Documentation
First time setup
- Install node.js(version > 4.x.x)
- Clone this repository
- Install dependencies:
npm install
- Install typescript:
npm install -g typescript
Build & Testing
- Normal Build:
npm run build
- Test:
npm run test
- Watch:
npm run dev
, point your browser tohttp://localhost:8080/
Continuous Integration
The JSONForms project is build and tested via Travis. Coverage is documented by Coveralls.
License
The JSONForms project is licensed under the MIT License. See the LICENSE file for more information.
Roadmap
Our current roadmap is available here.