Dynamic Forms

A schema-driven form rendering component that generates complete forms from FormSchema definitions. Automatically selects the appropriate input component for each field type, with inline validation, conditional visibility, multi-column layouts, collapsible sections, and custom field renderers.

Default

A basic BbDynamicForm with a FormSchema defining fields. Use @bind-Values for two-way binding and OnValidSubmit for form submission.

Contact Form

Horizontal Layout

Set Layout="FormLayout.Horizontal" to place labels to the left of fields. Use LabelWidth to control the label column width.

Sections

Use FormSectionDefinition to group fields with headings. Sections can be Collapsible and support multi-column grids via Columns. When Sections is populated on the schema, Fields is ignored.

Personal Info

Preferences

Conditional Visibility

Fields with VisibleWhen expressions are evaluated against current form values. Hidden fields are automatically cleared from the values dictionary. Select a role below to see conditional fields appear.

Field Types

BbDynamicForm supports 28 field types via the FieldType enum. Each type automatically renders the appropriate Blazor Blueprint input component. Use Columns for multi-column layouts and ColSpan to span fields across columns.

Validation

Add Validations to fields for inline error display. Supports MinLength, MaxLength, Min, Max, Pattern, Email, Url, Phone, and Custom validators. Set Required for mandatory fields.

JSON Schema

Use FormSchemaParser.FromJson() to create forms from standard JSON Schema. Field types are inferred from JSON Schema keywords (type, format, enum, minimum, maxLength, etc.). Validation rules are generated automatically from constraints.

Native JSON

FormSchemaParser.FromJson() also accepts the native FormSchema JSON format, which maps directly to the C# model. This is useful for loading form definitions from a database, API, or configuration file.

Feedback Form