FormCraft.ForMudBlazor
2.3.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package FormCraft.ForMudBlazor --version 2.3.0
NuGet\Install-Package FormCraft.ForMudBlazor -Version 2.3.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FormCraft.ForMudBlazor" Version="2.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FormCraft.ForMudBlazor" Version="2.3.0" />
<PackageReference Include="FormCraft.ForMudBlazor" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FormCraft.ForMudBlazor --version 2.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: FormCraft.ForMudBlazor, 2.3.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FormCraft.ForMudBlazor@2.3.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FormCraft.ForMudBlazor&version=2.3.0
#tool nuget:?package=FormCraft.ForMudBlazor&version=2.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
FormCraft.ForMudBlazor
MudBlazor UI framework implementation for FormCraft dynamic forms.
Installation
dotnet add package FormCraft.ForMudBlazor
Usage
// In Program.cs
builder.Services.AddFormCraft();
builder.Services.AddFormCraftMudBlazor();
Project Structure
The project is organized by feature, with each field type having its own folder containing both the component and renderer:
FormCraft.ForMudBlazor/
├── Extensions/
│ └── ServiceCollectionExtensions.cs # DI registration
├── Features/
│ ├── MudBlazorUIFrameworkAdapter.cs # Main adapter implementation
│ ├── TextField/
│ │ ├── MudBlazorTextFieldComponent.razor
│ │ └── MudBlazorTextFieldRenderer.cs
│ ├── NumericField/
│ │ ├── MudBlazorNumericFieldComponent.razor
│ │ └── MudBlazorNumericFieldRenderer.cs
│ ├── BooleanField/
│ │ ├── MudBlazorBooleanFieldComponent.razor
│ │ └── MudBlazorBooleanFieldRenderer.cs
│ ├── DateTimeField/
│ │ ├── MudBlazorDateTimeFieldComponent.razor
│ │ └── MudBlazorDateTimeFieldRenderer.cs
│ ├── SelectField/
│ │ ├── MudBlazorSelectFieldComponent.razor
│ │ └── MudBlazorSelectFieldRenderer.cs
│ ├── FileUploadField/
│ │ ├── MudBlazorFileUploadFieldComponent.razor
│ │ └── MudBlazorFileUploadFieldRenderer.cs
│ ├── CustomFields/
│ │ └── RatingRenderer.cs
│ ├── FormContainer/
│ │ ├── FormCraftComponent.razor
│ │ └── FormCraftComponent.razor.cs
│ └── Validation/
│ ├── DynamicFormValidator.cs
│ ├── FieldValidationMessage.razor
│ └── FieldValidationMessage.razor.cs
Features
- Feature-based organization: Each field type is self-contained with its component and renderer
- MudBlazor components: Uses MudBlazor's rich component library
- Type-safe rendering: Strong typing throughout the rendering pipeline
- Validation support: Integrated validation with MudBlazor's validation system
- Custom field support: Extensible architecture for custom field types
Creating Custom Fields
To add a new field type:
- Create a new feature folder under
Features/
- Add your component (
.razor
file) and renderer (.cs
file) - Register the renderer in
ServiceCollectionExtensions.cs
Example:
// Features/ColorPickerField/MudBlazorColorPickerFieldRenderer.cs
public class MudBlazorColorPickerFieldRenderer : FieldRendererBase
{
protected override Type ComponentType => typeof(MudBlazorColorPickerFieldComponent<>);
public override bool CanRender(Type fieldType, IFieldConfiguration<object, object> field)
=> fieldType == typeof(string) && field.AdditionalAttributes.ContainsKey("color-picker");
}
// Features/ColorPickerField/MudBlazorColorPickerFieldComponent.razor
@namespace FormCraft.ForMudBlazor.Features.ColorPickerField
@typeparam TModel
@inherits FieldComponentBase<TModel, string>
<MudColorPicker T="string"
Label="@Label"
@bind-Value="@CurrentValue"
Required="@IsRequired"
ReadOnly="@IsReadOnly"
Disabled="@IsDisabled" />
Dependencies
- FormCraft (core library)
- MudBlazor (UI components)
- Microsoft.AspNetCore.Components.Web
License
This package is part of the FormCraft project and follows the same MIT license.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- FormCraft (>= 2.3.0)
- Microsoft.AspNetCore.Components.Web (>= 9.0.6)
- MudBlazor (>= 8.9.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.