JSONForms
More forms. Less code.
Complex forms in the blink of an eye
Version: v3.0.0
@next: 3.0.0
Declare your forms as JSON based on a JSON Schema
Fully-featured forms including data-binding, input validation, and rule-based visibility out-of-the-box
Designed for customizability - from custom styling to custom widgets
JSON Forms is a JSON Schema based approach for creating forms.
It comes with off the shelf support for React, Angular and Vue.
- Demo
- Schema
- UI Schema
- Data
schema.json
{"type": "object","required": ["age"],"properties": {"firstName": {"type": "string","minLength": 2,"maxLength": 20},"lastName": {"type": "string","minLength": 5,"maxLength": 15},"age": {"type": "integer","minimum": 18,"maximum": 100},"gender": {"type": "string","enum": ["Male","Female","Undisclosed"]},"height": {"type": "number"},"dateOfBirth": {"type": "string","format": "date"},"rating": {"type": "integer"},"committer": {"type": "boolean"},"address": {"type": "object","properties": {"street": {"type": "string"},"streetnumber": {"type": "string"},"postalCode": {"type": "string"},"city": {"type": "string"}}}}}
uischema.json
{"type": "VerticalLayout","elements": [{"type": "HorizontalLayout","elements": [{"type": "Control","scope": "#/properties/firstName"},{"type": "Control","scope": "#/properties/lastName"}]},{"type": "HorizontalLayout","elements": [{"type": "Control","scope": "#/properties/age"},{"type": "Control","scope": "#/properties/dateOfBirth"}]},{"type": "HorizontalLayout","elements": [{"type": "Control","scope": "#/properties/height"},{"type": "Control","scope": "#/properties/gender"},{"type": "Control","scope": "#/properties/committer"}]},{"type": "Group","label": "Address for Shipping T-Shirt","elements": [{"type": "HorizontalLayout","elements": [{"type": "Control","scope": "#/properties/address/properties/street"},{"type": "Control","scope": "#/properties/address/properties/streetnumber"}]},{"type": "HorizontalLayout","elements": [{"type": "Control","scope": "#/properties/address/properties/postalCode"},{"type": "Control","scope": "#/properties/address/properties/city"}]}],"rule": {"effect": "ENABLE","condition": {"scope": "#/properties/committer","schema": {"const": true}}}}]}
{"firstName": "Max","lastName": "Power"}
We've got an early present for you 🎁! Today we merged the last feature for JSON Forms 3.0 and released the first beta version
22th December 2021
v3.0.0-beta.0
🎉 Try our new ESM module builds today! Stable release coming in the new year 🥳22th December 2021
JSON Forms Architecture
JSON Forms has a modular architecture and can be customized on every level. The core functionality is pure Javascript and therefore independent from any UI framework. We offer bindings for React, Angular and Vue. For more information see here.