Ae.MudBlazor.Forms 1.0.0

dotnet add package Ae.MudBlazor.Forms --version 1.0.0
                    
NuGet\Install-Package Ae.MudBlazor.Forms -Version 1.0.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="Ae.MudBlazor.Forms" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ae.MudBlazor.Forms" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Ae.MudBlazor.Forms" />
                    
Project file
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 Ae.MudBlazor.Forms --version 1.0.0
                    
#r "nuget: Ae.MudBlazor.Forms, 1.0.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 Ae.MudBlazor.Forms@1.0.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=Ae.MudBlazor.Forms&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Ae.MudBlazor.Forms&version=1.0.0
                    
Install as a Cake Tool

MudBlazor.Forms

MudBlazor.Forms is a library built on top of MudBlazor for creating responsive, dynamic, and highly customizable forms in Blazor applications. It simplifies form handling, validation, and binding, offering a clean and efficient way to work with structured data inputs in Blazor.

Features

  • Seamless Blazor Integration: Easily integrate with MudBlazor components for a consistent and beautiful UI.
  • Dynamic Form Creation: Automatically generate forms based on data models with minimal configuration.
  • Form Validation: Built-in validation support, compatible with Data Annotations and custom validation logic.
  • Custom Field Types: Support for custom field types and layouts, making forms flexible and extensible.
  • Responsive Design: Fully responsive form components out-of-the-box, adapting to various screen sizes.
  • Styled by MudBlazor: Use MudBlazor's theming and design system for professional, modern UI styling.

Installation

You can install MudBlazor.Forms via the NuGet package manager:

Install-Package MudBlazor.Forms

Usage

  • See Examples

  • Import the required namespaces into your Blazor project.

@using MudBlazor
@using MudBlazor.Forms
  • Annotate your classes or use fluent API to define validation rules.
    public class InteractiveStarship
    {

        [AeFormIgnore]
        private int ID { get; set; } = 1;

        [Required]
        [StringLength(16, ErrorMessage = "Identifier too long (16 character limit).")]
        [MudForm(Placeholder ="Starship identifier...")]
        public string Identifier { get; set; }

        [Required]
        [RegularExpression(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$", ErrorMessage = "Invalid Email Address")]
        [StringLength(20, ErrorMessage = "Identifier too long (16 character limit).")]
        [MudForm(Placeholder = "Enter Email...")]
        public string CaptainsEmail { get; set; }

        [Editable(false)]
        [MudForm(Placeholder ="Describe your starship including crew size")]
        public string Description { get; set; }

        [Required]
        [MudForm(IsDropDown =true)]
        public string Classification { get; set; }

        [Required]
        [MudForm(IsDropDown = true)]
        public string SubClassification { get; set; }

        [Range(1, 100000, ErrorMessage = "Accommodation invalid (1-100000).")]
        [MudForm(Label = "Maximum Accomodation")]
        [DisplayFormat(DataFormatString = "C2")]
        public double MaximumAccommodation { get; set; }

        [MudForm(Label = "Maintenance Cost")]
        [Editable(false)]
        [DisplayFormat(DataFormatString = "C2")]
        public double MaintenanceCost => MaximumAccommodation * 100;

        [Required]
        [Range(typeof(bool), "true", "true", ErrorMessage = "This form disallows unapproved ships.")]
        [MudForm("Validated Design")]
        public bool IsValidatedDesign { get; set; }

        [Required]
        [MudForm("Production Date")]
        [DisplayFormat(DataFormatString = "yyyy/MM/dd")]
        public DateTime ProductionDate { get; set; }

        [Editable(false)]
        [DisplayFormat(DataFormatString = "yyyy/MM/dd")]
        public DateTime? FirstFlightDate { get; set; }

        public int? SubLightEngines { get; set; }
    }
  • Use MudForm components in your Blazor pages to generate dynamic forms.
<MudModelForm T="InteractiveStarship"
             Model="@_starship"
             SubmitLabel="Save changes"
             OnValidSubmit="HandleValidSubmit"
             IsReadOnly="false"
             CancelLabel="Cancel"    
             IsSubmitEnabled="true"
             OnConfigure="OnConfigure"
             OnCancel="CreateStarship" />
  • Customize the form using MudBlazor's extensive styling and component system.

Contributing

Contributions are welcome! Please feel free to open issues or submit pull requests to help improve this project.

License

MudBlazor.Forms is licensed under the MIT License. See LICENSE for more details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 12,444 10/23/2024
0.5.22329.4-beta 10,705 11/25/2022
0.5.22321.2-beta 315 11/17/2022
0.5.22285.2-beta 537 10/12/2022
0.5.22264.1-beta 208 9/21/2022
0.5.22262.2-beta 235 9/19/2022
0.5.22255.6-beta 179 9/13/2022
0.5.22255.5-beta 174 9/12/2022
0.5.22255.4-beta 177 9/12/2022
0.5.22244.2-beta 195 9/1/2022
0.5.22240.2-beta 211 8/29/2022
0.5.22238.1-beta 187 8/26/2022
0.5.22223.6-beta 210 8/11/2022