IonBlazor.Components 0.887.13

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

IonBlazor.Components

Razor / Blazor wrappers for Ionic Framework web components.

C# component types only. Does not include Ionic's JavaScript bundle, CSS, or icons. Use this package when you want to control how Ionic itself is loaded — typically a CDN reference, or in a MAUI Hybrid solution where only one project is allowed to ship the static assets.

For the all-in-one experience (wrappers + every static asset), install IonBlazor instead.

Install

dotnet add package IonBlazor.Components

Setup

You're responsible for loading Ionic's JS and CSS. Two common approaches:

Option 1 — Load Ionic from a CDN

In your host page (wwwroot/index.html, _Host.cshtml, or App.razor):

<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.esm.js"></script>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core/css/core.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core/css/ionic.bundle.css" />

Option 2 — Add the asset packages explicitly

dotnet add package IonBlazor.StaticAssets         # JS interop modules (required)
dotnet add package IonBlazor.StaticAssets.Ionic   # Ionic JS bundle + CSS
dotnet add package IonBlazor.StaticAssets.Ionic.Svg  # Ionic SVG icons (optional)

Then point your host page at _content/IonBlazor/... — see the IonBlazor package README for the snippet.

Add the namespaces to _Imports.razor:

@using IonBlazor.Components
@using IonBlazor.Components.Abstractions
@using IonBlazor.Services

Controllers → Services migration

The four overlay controllers (IonAlertController, IonActionSheetController, IonToastController, IonLoadingController) have been replaced by scoped DI services (IonAlertService, IonActionSheetService, IonToastService, IonLoadingService) with instance methods. Each old controller is retained as an [Obsolete(error: true)] stub so existing call sites fail the build with a pointer to this section.

Why

The legacy controllers worked by being rendered once at the app root (<IonAlertController/> in App.razor / MainLayout.razor) so they could [Inject] IJSRuntime and stash it in a static field that every PresentAsync static call then read.

On Blazor WebAssembly there's one circuit per browser tab, so this happens to work. On Blazor Server, IJSRuntime is per-circuit — the static field gets overwritten by whichever circuit renders last, and every other connected user's calls then dispatch through the wrong circuit. The DI version eliminates the static state entirely.

Register the services

// Program.cs / MauiProgram.cs
builder.Services.AddIonBlazor();

AddIonBlazor() registers all four services scoped — one call covers the lot.

Migration — same shape for all four

The pattern is identical for every controller. Pick the appropriate row:

Legacy controller Injected service
IonAlertController IonAlertService
IonActionSheetController IonActionSheetService
IonToastController IonToastService
IonLoadingController IonLoadingService

Before — IonAlertController (legacy, deprecated)

@* Main.razor or MainLayout.razor *@
<IonAlertController />

@* Some component *@
@code {
    private async Task Show()
    {
        await IonAlertController.PresentAsync(options =>
        {
            options.Header = "Heads up";
            options.Message = "Hello.";
        });
    }
}

After — IonAlertService (injected)

@inject IonAlertService AlertService

@code {
    private async Task Show()
    {
        await AlertService.PresentAsync(options =>
        {
            options.Header = "Heads up";
            options.Message = "Hello.";
        });
    }
}

Then remove every <IonAlertController/>, <IonActionSheetController/>, <IonToastController/>, and <IonLoadingController/> tag from your root layout / App.razor.

IonLoadingController.Create (sync) was removed

The synchronous Create(...) wrapper on IonLoadingController (which internally called CreateAsync(...).GetAwaiter().GetResult()) has been dropped. Call IonLoadingService.CreateAsync(...) directly — it returns the same IonLoadingReference type as before.

Compile-time signal

Every Ion*Controller is now an [Obsolete(error: true)] stub. Old markup tags and static calls fail the build with a message pointing at this section. Migrate, register AddIonBlazor(), and delete the tags from your root layout.

MAUI Hybrid

In a MAUI Hybrid solution with multiple Razor projects, only one project can ship the static assets — otherwise MAUI's packaging fails with a duplicate-static-asset error.

Pick one project to carry the assets (typically the MAUI host) and have it reference either:

Every other project in the solution references only IonBlazor.Components — no assets, just the C# types — so the wrappers stay available everywhere while the assets ship exactly once.

Supported frameworks

net8.0, net9.0, net10.0.

License

MIT.

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 IonBlazor.Components:

Package Downloads
IonBlazor

IonBlazor bundle — includes all components and static assets.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.887.13 55 6/2/2026
0.887.12 83 5/31/2026
0.887.11 123 5/26/2026
0.887.9 100 5/21/2026
0.887.8 119 5/18/2026
0.887.7 114 5/18/2026
0.887.0 117 5/17/2026
0.872.1 256 8/19/2025
0.843.1-alpha.1 211 4/30/2025