@mistio/mist-form
Version:
A Webcomponent that renders a form defined by a JSONSchema & an optional UISchema spec
75 lines • 1.85 kB
JSON
{
"jsonSchema": {
"title": "A registration form",
"description": "A simple form example.",
"type": "object",
"required": [
"firstName",
"lastName",
"telephone"
],
"properties": {
"salutation": {
"type": "string",
"enum": ["Mr", "Mrs", "Ms", "Dr", "Ser"]
},
"firstName": {
"type": "string",
"title": "First name",
"default": "Chuck"
},
"lastName": {
"type": "string",
"title": "Last name"
},
"telephone": {
"type": "string",
"title": "Telephone",
"minLength": 10
}
}
},
"uiSchema": {
"salutation": {
"ui:widget": "radio"
},
"firstName": {
"ui:autofocus": true,
"ui:emptyValue": "",
"ui:autocomplete": "family-name"
},
"lastName": {
"ui:emptyValue": "",
"ui:autoselect": true,
"ui:autocomplete": "given-name"
},
"age": {
"ui:widget": "updown",
"ui:title": "Age of person",
"ui:description": "(earthian year)"
},
"bio": {
"ui:widget": "textarea"
},
"password": {
"ui:widget": "password",
"ui:help": "Hint: Make it strong!"
},
"date": {
"ui:widget": "alt-datetime"
},
"telephone": {
"ui:options": {
"inputType": "tel"
}
}
},
"formData": {
"salutation": "Dr",
"firstName": "Chuck",
"lastName": "Norris",
"age": 75,
"bio": "Roundhouse kicking asses since 1940",
"password": "noneed"
}
}