A powerful and flexible form builder based on JSON Schema
View on GitHubAdd the component to your HTML using a CDN:
<script type="module" src="https://unpkg.com/json-schema-form-render@latest/dist/form-builder.js"></script>
Or install via npm:
npm install json-schema-form-render
Define the schema directly in the HTML:
<form-builder
schema='{
"fields": [
{
"type": "text",
"name": "username",
"label": "Username",
"required": true
}
]
}'
></form-builder>
Set the schema using JavaScript:
const schema = {
fields: [
{
type: "text",
name: "username",
label: "Username",
required: true
}
]
};
document.getElementById('form-builder')
.setAttribute('schema', JSON.stringify(schema));
Load the schema from an external file:
<form-builder schema-url="schema.json"></form-builder>
Support for text, email, password, select, radio, checkbox, date, color, file, and more.
Customize the appearance with theme styles and colors.
Built-in validation with customizable error messages.
Fully responsive forms that work on all devices.
Try out the form builder with different themes and configurations: