Substantive.Blazor.DynamicForm 9.4.0-build20260421r11
Substantive.Blazor.DynamicForm
A small library of Blazor components and helpers for rendering nested object graphs as editable forms using FormCraft and MudBlazor.
Features
- Build a deterministic form tree from a model instance and render nested sections (root, children) as separate FormCraft forms.
- Support for grouped layouts: None (flattened), Tabs, Stepper, Sidebar.
- Automatic attribute-driven configuration via AttributeFormBuilderExtensions.AddFieldsFromAttributesAndDisplayAttribute
(). - DefaultFormConfigurationProvider to create and cache per-type FormCraft configurations.
Quick start
- Add a project reference to this package or include the project in your solution.
- Ensure FormCraft and MudBlazor are available to the consuming project.
- Use the NestedFormCraftComponent in a Razor page or component:
@using Substantive.Blazor.DynamicForm
<NestedFormCraftComponent TModel="MyModel" Model="@model" Layout="GroupLayout.Tabs" ShowSubmitButton="true" OnValidSubmit="HandleSubmit" />
@code {
private MyModel model = new();
private Task HandleSubmit(MyModel? m)
{
// handle valid submit from any nested section (model contains latest values)
return Task.CompletedTask;
}
}
Key component parameters
- TModel / Model: root model type and instance used to build the form tree.
- MaxDepth: maximum nested discovery depth (default 3).
- Layout: GroupLayout.None | GroupLayout.Tabs | GroupLayout.Stepper | GroupLayout.Sidebar.
- SelectedNodeKey / SelectedNodeKeyChanged: control or observe selected section.
- ConfigurationProvider: supply a custom provider or use DefaultFormConfigurationProvider to resolve per-type FormCraft configurations.
- TopLevelGroupTitle / TopLevelGroupDescription: presentation-only overrides for the synthetic root-fields group.
- ShowSubmitButton / SubmitButtonText / SubmitButtonClass / SubmittingText: presentation options forwarded to nested forms.
- OnValidSubmit: centralized callback invoked when a nested form submits successfully.
Advanced
- Use AttributeFormBuilderExtensions.AddFieldsFromAttributesAndDisplayAttribute
() together with FormCraft attributes on your models to generate field configurations from attributes and DisplayAttribute values. - DefaultFormConfigurationProvider creates and caches FormCraft configurations per runtime type to avoid repeated reflection.
References
- FormCraft: https://phmatray.github.io/FormCraft/home
Showing the top 20 packages that depend on Substantive.Blazor.DynamicForm.
| Packages | Downloads |
|---|---|
|
Substantive.DevTools.Blazor
Substantive Blazor development tools.
|
5 |
|
Substantive.DevTools.Blazor
Substantive Blazor development tools.
|
6 |
|
Substantive.DevTools.Blazor
Substantive Blazor development tools.
|
7 |
|
Substantive.DevTools.Blazor
Substantive Blazor development tools.
|
8 |
|
Substantive.DevTools.Blazor
Substantive Blazor development tools.
|
10 |
|
Substantive.Metapackage.Blazor
A metapackage contains all Blazor essential building blocks. It packed standalone Blazor components and extensions that often use such as JSInterop, BrowserInterop, Navigation, Exception Handling, Localization, etc,.
|
29 |
.NET 10.0
- FormCraft (>= 2.5.0)
- FormCraft.ForMudBlazor (>= 2.5.0)
- Microsoft.AspNetCore.Components.Web (>= 10.0.6)
- MudBlazor (>= 8.15.0)