I-Synergy.Framework.UI.Blazor 2025.11029.10201.38-preview

Prefix Reserved
This is a prerelease version of I-Synergy.Framework.UI.Blazor.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package I-Synergy.Framework.UI.Blazor --version 2025.11029.10201.38-preview
                    
NuGet\Install-Package I-Synergy.Framework.UI.Blazor -Version 2025.11029.10201.38-preview
                    
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="I-Synergy.Framework.UI.Blazor" Version="2025.11029.10201.38-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="I-Synergy.Framework.UI.Blazor" Version="2025.11029.10201.38-preview" />
                    
Directory.Packages.props
<PackageReference Include="I-Synergy.Framework.UI.Blazor" />
                    
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 I-Synergy.Framework.UI.Blazor --version 2025.11029.10201.38-preview
                    
#r "nuget: I-Synergy.Framework.UI.Blazor, 2025.11029.10201.38-preview"
                    
#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 I-Synergy.Framework.UI.Blazor@2025.11029.10201.38-preview
                    
#: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=I-Synergy.Framework.UI.Blazor&version=2025.11029.10201.38-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=I-Synergy.Framework.UI.Blazor&version=2025.11029.10201.38-preview&prerelease
                    
Install as a Cake Tool

I-Synergy Framework UI Blazor

Blazor UI framework for building modern web applications with WebAssembly or Server-side rendering. This package provides a complete Blazor implementation of the I-Synergy Framework UI services, components, and patterns.

NuGet License .NET Platform

Features

  • Blazor WebAssembly and Server support
  • Authentication and authorization with JWT support
  • Form factor service for responsive design
  • Exception handling with user-friendly error messages
  • Static asset service for loading configuration and resources
  • Antiforgery token support for secure forms
  • HTTP resilience with retry policies
  • Component extensions for common patterns
  • JavaScript interop extensions
  • Integration with MVVM framework for ViewModels

Installation

Install the package via NuGet:

dotnet add package I-Synergy.Framework.UI.Blazor

Quick Start

1. Configure Services

Setup your Blazor application with I-Synergy Framework:

using ISynergy.Framework.UI.Extensions;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;

var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");

// Configure I-Synergy Framework services
builder.Services.ConfigureServices<AppContext, CommonServices, SettingsService, Resources>(
    builder.Configuration,
    InfoService.Default,
    services =>
    {
        // Register additional services
        services.AddScoped<IProductService, ProductService>();
        services.AddScoped<MainViewModel>();
    },
    Assembly.GetExecutingAssembly(),
    assemblyName => assemblyName.Name.StartsWith("MyApp")
);

await builder.Build().RunAsync();

2. Create Razor Components

@page "/products"
@using ISynergy.Framework.Mvvm.Abstractions.ViewModels
@inject IProductService ProductService
@inject IDialogService DialogService

<h3>Products</h3>

@if (products == null)
{
    <p><em>Loading...</em></p>
}
else
{
    <table class="table">
        <thead>
            <tr>
                <th>Name</th>
                <th>Price</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var product in products)
            {
                <tr>
                    <td>@product.Name</td>
                    <td>@product.Price.ToString("C")</td>
                    <td>
                        <button class="btn btn-primary" @onclick="() => EditProduct(product)">Edit</button>
                        <button class="btn btn-danger" @onclick="() => DeleteProduct(product)">Delete</button>
                    </td>
                </tr>
            }
        </tbody>
    </table>
}

@code {
    private List<Product> products;

    protected override async Task OnInitializedAsync()
    {
        try
        {
            products = await ProductService.GetAllAsync();
        }
        catch (Exception ex)
        {
            await DialogService.ShowErrorAsync(ex, "Error");
        }
    }

    private async Task EditProduct(Product product)
    {
        // Navigate to edit page or show dialog
    }

    private async Task DeleteProduct(Product product)
    {
        var confirmed = await DialogService.ShowMessageAsync(
            $"Are you sure you want to delete {product.Name}?",
            "Confirm Delete",
            MessageBoxButtons.YesNo);

        if (confirmed == MessageBoxResult.Yes)
        {
            await ProductService.DeleteAsync(product.Id);
            products.Remove(product);
            StateHasChanged();
        }
    }
}

3. Authentication

Configure authentication with JWT:

// In Program.cs
builder.Services.AddAuthorizationCore();
builder.Services.AddCascadingAuthenticationState();

// Configure HTTP client with authentication
builder.Services.AddScoped(sp => new HttpClient
{
    BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)
});

<CascadingAuthenticationState>
    <Router AppAssembly="@typeof(App).Assembly">
        <Found Context="routeData">
            <AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
                <NotAuthorized>
                    <RedirectToLogin />
                </NotAuthorized>
            </AuthorizeRouteView>
        </Found>
        <NotFound>
            <PageTitle>Not found</PageTitle>
            <LayoutView Layout="@typeof(MainLayout)">
                <p role="alert">Sorry, there's nothing at this address.</p>
            </LayoutView>
        </NotFound>
    </Router>
</CascadingAuthenticationState>

4. Form Factor Service

Detect and respond to device form factors:

@inject IFormFactorService FormFactorService

<div class="@(FormFactorService.IsMobile ? "mobile-layout" : "desktop-layout")">
    @if (FormFactorService.IsMobile)
    {
        <MobileNavigation />
    }
    else
    {
        <DesktopNavigation />
    }
</div>

@code {
    protected override void OnInitialized()
    {
        FormFactorService.FormFactorChanged += OnFormFactorChanged;
    }

    private void OnFormFactorChanged(object sender, EventArgs e)
    {
        StateHasChanged();
    }

    public void Dispose()
    {
        FormFactorService.FormFactorChanged -= OnFormFactorChanged;
    }
}

5. JavaScript Interop Extensions

Use JavaScript interop extensions:

using ISynergy.Framework.UI.Extensions;
using Microsoft.JSInterop;

@inject IJSRuntime JS

@code {
    private async Task ShowAlertAsync()
    {
        await JS.InvokeVoidAsync("alert", "Hello from Blazor!");
    }

    private async Task<string> GetLocalStorageItemAsync(string key)
    {
        return await JS.InvokeAsync<string>("localStorage.getItem", key);
    }

    private async Task SetLocalStorageItemAsync(string key, string value)
    {
        await JS.InvokeVoidAsync("localStorage.setItem", key, value);
    }
}

6. Static Asset Service

Load configuration from static assets:

using ISynergy.Framework.UI.Abstractions.Services;

public class ConfigurationViewModel : ViewModel
{
    private readonly IStaticAssetService _staticAssetService;

    public ConfigurationViewModel(
        ICommonServices commonServices,
        IStaticAssetService staticAssetService,
        ILogger<ConfigurationViewModel> logger)
        : base(commonServices, logger)
    {
        _staticAssetService = staticAssetService;
    }

    public override async Task InitializeAsync()
    {
        await base.InitializeAsync();

        // Load configuration from wwwroot/appsettings.json
        var config = await _staticAssetService.GetConfigurationAsync();

        // Load custom JSON
        var customData = await _staticAssetService.LoadJsonAsync<CustomData>("data/custom.json");

        IsInitialized = true;
    }
}

Component Extensions

The Blazor framework provides useful component extensions:

@using ISynergy.Framework.UI.Extensions


@if (items.HasItems())
{
    <ul>
        @foreach (var item in items)
        {
            <li>@item.Name</li>
        }
    </ul>
}


<p>@Model?.Name?.ToUpper()</p>


<p>Price: @price.ToCurrency()</p>
<p>Date: @date.ToLocalString(LanguageService)</p>

HTTP Resilience

Configure HTTP resilience with retry policies:

// In Program.cs
builder.Services.AddHttpClient<IProductService, ProductService>(client =>
{
    client.BaseAddress = new Uri(builder.Configuration["ApiBaseUrl"]);
})
.AddStandardResilienceHandler(options =>
{
    options.Retry.MaxRetryAttempts = 3;
    options.Retry.BackoffType = DelayBackoffType.Exponential;
    options.CircuitBreaker.SamplingDuration = TimeSpan.FromSeconds(10);
});

Exception Handling

Centralized exception handling:

<ErrorBoundary>
    <ChildContent>
        @Body
    </ChildContent>
    <ErrorContent Context="exception">
        <div class="alert alert-danger">
            <h4>An error occurred</h4>
            <p>@exception.Message</p>
            @if (IsDevelopment)
            {
                <pre>@exception.StackTrace</pre>
            }
        </div>
    </ErrorContent>
</ErrorBoundary>

Best Practices

Use StateHasChanged() sparingly and only when necessary to improve performance.

Always dispose of event handlers and IDisposable resources in @code blocks.

Blazor WebAssembly runs in the browser sandbox with security restrictions.

Performance

  • Minimize re-renders with @key directive
  • Use virtualization for large lists
  • Implement lazy loading for components
  • Optimize bundle size
  • Use streaming rendering for server-side

Security

  • Always validate input on the server
  • Use HTTPS for all communication
  • Implement proper authentication and authorization
  • Protect against CSRF with antiforgery tokens
  • Sanitize user input

State Management

  • Use cascading parameters for shared state
  • Implement services for cross-component communication
  • Use browser storage for persistence
  • Consider state containers for complex scenarios

Dependencies

  • I-Synergy.Framework.UI - Base UI abstractions
  • Microsoft.AspNetCore.Components.Web - Blazor components
  • Microsoft.AspNetCore.Components.Authorization - Authentication support
  • Microsoft.Extensions.Http.Resilience - HTTP resilience
  • System.IdentityModel.Tokens.Jwt - JWT token handling

Platform Requirements

  • Target Framework: net10.0
  • Browser Support: Modern browsers (Chrome, Edge, Firefox, Safari)
  • WebAssembly Support: Required for Blazor WebAssembly
  • Server Requirements: ASP.NET Core 10.0+ for Blazor Server

Documentation

  • I-Synergy.Framework.UI - Base UI abstractions
  • I-Synergy.Framework.Core - Core framework
  • I-Synergy.Framework.Mvvm - MVVM framework
  • I-Synergy.Framework.AspNetCore - ASP.NET Core integration
  • I-Synergy.Framework.UI.Maui - MAUI implementation

Support

For issues, questions, or contributions, please visit the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET 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 I-Synergy.Framework.UI.Blazor:

Package Downloads
I-Synergy.Framework.UI.Maui.Blazor

I-Synergy Framework UI for Maui Hybrid with Blazor

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2025.11102.12003.8-preview 21 11/2/2025
2025.11102.11228.52-preview 28 11/2/2025
2025.11102.10309.42-preview 31 11/2/2025
2025.11029.11433.38-preview 115 10/29/2025
2025.11029.10201.38-preview 115 10/29/2025
2025.11027.11947.55-preview 116 10/27/2025
2025.11022.12207.12-preview 110 10/22/2025
2025.11019.12053.37-preview 117 10/19/2025
2025.11016.11750.24-preview 109 10/16/2025
2025.11015.10219.44-preview 120 10/15/2025
2025.11014.10245.12-preview 115 10/14/2025
2025.11012.10130.11-preview 54 10/12/2025
2025.11010.10052.52-preview 113 10/9/2025
2025.11001.12118.13-preview 127 10/1/2025
2025.10925.10144.25-preview 123 9/25/2025
2025.10921.11353.29-preview 154 9/21/2025
2025.10913.11841.29-preview 104 9/13/2025
2025.10912.12351.59-preview 57 9/12/2025
2025.10912.10210.52-preview 125 9/12/2025
2025.10911.10131.43-preview 130 9/10/2025
2025.10910.12340.34-preview 128 9/10/2025
2025.10910.11327.15-preview 126 9/10/2025
2025.10910.11206.45-preview 120 9/10/2025
2025.10910.10230.58-preview 126 9/10/2025
2025.10908.12343.47-preview 124 9/8/2025
2025.10904.12337.35-preview 140 9/4/2025
2025.10904.12245.51-preview 134 9/4/2025
2025.10904.11425.5-preview 138 9/4/2025
2025.10904.10323.39-preview 140 9/4/2025
2025.10826.11425.3-preview 191 8/26/2025
2025.10825.12350.9-preview 141 8/25/2025
2025.10810.10248-preview 82 8/10/2025
2025.10809.10146.35-preview 119 8/9/2025
2025.10806.12031.49-preview 203 8/6/2025
2025.10806.11955.54-preview 200 8/6/2025
2025.10806.11433.24-preview 205 8/6/2025
2025.10709.10105.39-preview 127 7/8/2025
2025.10707.12320.3-preview 129 7/7/2025
2025.10706.11957.9-preview 125 7/6/2025
2025.10702.11752.47-preview 118 7/2/2025
2025.10702.11256.17-preview 130 7/2/2025
2025.10702.11119.10-preview 125 7/2/2025
2025.10702.10000.31-preview 130 7/1/2025
2025.10701.11524.1-preview 132 7/1/2025
2025.10701.11310.13-preview 127 7/1/2025
2025.10630.12022.58-preview 129 6/30/2025
2025.10612.12134.8-preview 274 6/12/2025
2025.10611.12313.53-preview 271 6/11/2025