JSON Schema Form

Discriminator: jsonSchemaForm
Fluent UI Blazor Component: Custom (built on Fluent UI primitives)

Description

The JsonSchemaForm component automatically generates a form from a JSON Schema definition. It renders input fields for each schema property, handles validation according to schema constraints, and collects user input as a JSON object. This component is ideal for gathering structured user input without building custom forms.


Properties

Property

Type

Required

Default

Description

component

string

✅ Yes

"jsonSchemaForm"

Type discriminator

style

string

No

null

Inline CSS style

id

string

No

null

Component identifier for data binding (required to collect form data)

schema

JsonSchema

✅ Yes

JSON Schema definition used to generate the form fields

data

JsonNode

No

null

Initial JSON data to pre-populate the form

gap

string

No

"0.5rem"

CSS flex container gap between form fields


Data Binding

When the JsonSchemaForm has an id and is referenced by a button's data binding, it provides the current form data as a JSON node. The data structure matches the schema's properties.

Validation

When validated, the form evaluates the current data against the JSON Schema:

  • Required fields must be filled.

  • Type constraints (string, number, boolean, etc.) must be satisfied.

  • Validation errors are returned as human-readable messages with property paths.


JSON Example

Contact Form

Rendering...

Pre-populated Form

Rendering...

Form with Flow Start Button

Rendering...

See Also