BlazorEngine 2.0.2

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

BlazorEngine

BlazorEngine is a library that lets you generate full-featured Blazor UI pages from your C# models and explicit configuration. It is designed for rapid development of CRUD-style apps, admin panels, and internal tools, with minimal boilerplate.

Features

  • Automatic UI generation: List, Card, Worksheet, and Two-List (side-by-side) pages are generated from your models.
  • Typed menu registration: Register pages with options.AddMenuItem<TPage>(...) in the host. No assembly scans, metadata files, generated initializers, or custom MSBuild tasks are required.
  • Action buttons: Override CreatePageActions() and CreateGridActions() with typed delegates. Action errors propagate to the existing error boundary.
  • Expression-based fields: Declare fields using fields.Add(x => x.Name) and fluent customization. Existing model display captions remain supported.
  • Icon instances: Pass icons directly, such as new Size20.Run(), without resolving icon types from metadata.
  • Existing UI behavior: Selection, button visibility, dialogs, Excel export, keyboard refresh, background tasks, themes, and session-aware ISecurity checks remain supported.
  • Custom Razor pages: You can still write custom Razor components/pages as needed.

How to Use

  1. Reference BlazorEngine in your Blazor project (WebAssembly, Server, or MAUI Blazor).
  2. Configure a page explicitly. Existing layout namespaces and lifecycle hooks are retained:
using BlazorEngine.Actions;
using BlazorEngine.Fields;
using BlazorEngine.Layouts;
using Microsoft.AspNetCore.Components;

public class Product
{
  public string Name { get; set; } = string.Empty;
}

[Route(Route)]
public class Products : ListPage<Product>
{
  public const string Route = "/products";
  public override string Title => "Products";

  protected override Task ConfigureFields(FieldListBuilder<Product> fields)
  {
    fields.Add(x => x.Name).Caption("Product name").Required();
    return Task.CompletedTask;
  }

  protected override Task LoadData()
  {
    Content = new[] { new Product { Name = "Example" } };
    return Task.CompletedTask;
  }

  protected override IReadOnlyList<PageActionDefinition> CreatePageActions() =>
    [new("Refresh", RefreshAsync)];

  private async Task RefreshAsync()
  {
    await LoadData();
    StateHasChanged();
  }
}
  1. Register menu entries in your host. Blazor's normal Router still handles page routes; a page does not have to be in the menu to be routable or used as a modal/edit form.
builder.Services.AddBlazorEngine(options =>
{
  options.AddMenuItem<Products>("Products", Products.Route);
  options.AddFooterItem("Issue?", "https://github.com/f4n0/BlazorGenerator", openInNewTab: true);
});

Registrations default to full permissions and can restrict them with PermissionFlags from BlazorEngine.Security. These flags are intersected with the existing ISecurity provider's permissions; they never override a provider denial. The legacy permission model has no separate read gate, so Read is reserved rather than adding new access behavior. Menu order defaults to 999; equally ordered items retain registration order. Action icons keep the existing Filled Run default, and menu icons keep the Filled Balloon default.

  1. See the Demo: Demo/TestShared/DemoRegistration.cs is the single registration block shared by all four demo hosts. The Demo/TestShared project contains sample models and demonstrates all features. Explore it for real-world usage.

Getting Started

  • Clone this repository.
  • Open the solution in Visual Studio.
  • Set one of the demo projects (WebAssembly, Server, or MAUI) as the startup project.
  • Run (F5) and explore the generated UI.

Special Note for .NET MAUI

Add this script to your index.html before the WebAssembly script:


<script app-name="MauiApp1"
        src="./_content/Microsoft.FluentUI.AspNetCore.Components/js/initializersLoader.webview.js"></script>

In the <BlazorEngineApp> tag, add the parameter: BlazorGenRenderMode="null"

Contributing

Contributions are welcome! Open issues or submit pull requests if you have ideas or improvements.

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 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 is compatible.  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 (1)

Showing the top 1 NuGet packages that depend on BlazorEngine:

Package Downloads
BlazorEngine.TestHelper

Give you utility classes for writing UnitTests for BlazorEngine Apps

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.2 91 11/5/2026
2.0.1 96 11/5/2026
1.0.71 178 8/19/2026
1.0.70 141 8/18/2026
1.0.69 154 8/18/2026
1.0.68 151 7/23/2026
1.0.67 147 7/23/2026
1.0.66 156 7/7/2026
1.0.65 145 7/6/2026
1.0.64 145 7/6/2026
1.0.63 146 7/6/2026
1.0.62 176 6/25/2026
1.0.61 161 6/15/2026
1.0.60 161 5/26/2026
1.0.59 155 5/19/2026
1.0.58 167 5/12/2026
1.0.57 168 3/18/2026
1.0.56 146 3/18/2026
1.0.55 139 3/18/2026
1.0.54 133 3/18/2026
Loading failed