The package contains MudBlazor extensions for the CG.Blazor.Forms package.
- CG.Blazor.Forms.Attributes.MudBlazorAttribute
- CG.Blazor.Forms.Attributes.RenderMudAlertAttribute
- CG.Blazor.Forms.Attributes.RenderMudAutocompleteAttribute
- CG.Blazor.Forms.Attributes.RenderMudCheckBoxAttribute
- CG.Blazor.Forms.Attributes.RenderMudColorPickerAttribute
- CG.Blazor.Forms.Attributes.RenderMudDatePickerAttribute
- CG.Blazor.Forms.Attributes.RenderMudFieldAttribute
- CG.Blazor.Forms.Attributes.RenderMudNumericFieldAttribute
- CG.Blazor.Forms.Attributes.RenderMudRadioGroupAttribute
- CG.Blazor.Forms.Attributes.RenderMudSelectAttribute
- CG.Blazor.Forms.Attributes.RenderMudSliderAttribute
- CG.Blazor.Forms.Attributes.RenderMudSwitchAttribute
- CG.Blazor.Forms.Attributes.RenderMudTextFieldAttribute
- CG.Blazor.Forms.Attributes.RenderMudTimePickerAttribute
- .NET 6.x or higher
The binary is hosted on NuGet. To install the package using the NuGet package manager:
PM> Install-Package CG.Blazor.Forms._MudBlazor
If you've spotted a bug in the code please use the project Issues HERE
We have a discussion group HERE
There is developer documentation HERE
We also blog about projects like this one on our website, HERE
There is a working quick start sample HERE
Steps to get started:
-
Create a Blazor project to get started.
-
Add MudBlazor to the project, since MudBlazor is (so far) the only supported UI package. HERE is a good link to get started with MudBlazor.
-
Add the CG.Blazor.Forms._MudBlazor NUGET package to the project.
-
Add
@using CG.Blazor.Forms._MudBlazor
to the _Imports.razor file. -
Add
<DynamicForm Model="@Model" OnValidSubmit="OnValidSubmit"/>
to the razor component where you want your dynamic form generated. Note thatModel
is a reference to your POCO object, andOnValidSubmit
is a reference to your form's submit handler. -
Add
services.AddMudBlazorFormGeneration();
to theConfigureServices
method of theStartup
class. -
Create your model type. Use attributes from the NUGET package to decorate any properties you want to be rendered on the form. Here is an example:
public class MyForm
{
[RenderMudTextField]
[Required]
public string FirstName { get; set; }
[RenderMudTextField]
[Required]
public string LastName { get; set; }
[RenderMudDatePicker]
public DateTime? DateOfBirth { get; set; }
}
This package and it's contents are experimental in nature. There is no official support. Use at your own risk.