ToastBlazor 1.0.16

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

ToastBlazor

Modern, lightweight, dependency‑free toast notifications for Blazor.
Built with pure C# and Razor — no JavaScript, no external libraries.

NuGet Version NuGet Downloads License


✨ Features

🚀 Zero JavaScript — 100% C# + Razor

🎨 Modern UI with multiple themes (Light, Dark, Minimal, Outline…)

🧩 Reusable <Toast> component

🌙 Light & Dark themes

🔧 Configurable positions (Top‑Right, Bottom‑Left, etc.)

⏱️ Auto‑dismiss + Infinite toasts

🎞️ Smooth animations

🖼️ Custom icons (SVG)

📦 NuGet‑ready — drop‑in component for any Blazor Web App

📦 Installation

Install via NuGet:

dotnet add package ToastBlazor

Or via Visual Studio → Manage NuGet Packages → TestNuget.


⚙️ Setup

  1. Register the service in Program.cs:

    builder.Services.AddToastBlazor();
    
  2. Add the container to your layout

    In MainLayout.razor:

    <ToastContainer />
    @Body
    
  3. Inject the service where you want to show toasts:

    @inject IToastService Toast
    

🎨 Stylesheet

ToastBlazor includes its own CSS file.
You must reference it manually in your project.

<link rel="stylesheet" href="_content/ToastBlazor/Styles/toastblazor.css" />

🔥 Usage Examples

Success toast

Toast.Success("Profile updated successfully!");

Error toast

Toast.Error("Something went wrong.");

Custom toast

Toast.Show(new ToastOptions
{
    Title = "New message",
    Message = "You have received a new notification.",
    Duration = 5000,
    Type = ToastType.Info
});

Infinite toast

Toast.ShowInfinite("Waiting for server...", ToastLevel.Warning);

Custom icon (SVG)

Toast.Show("Custom icon", ToastLevel.Success, "<svg>...</svg>");

📊 Progress Bar

Enabled by default on timed toasts:

Toast.Show("Auto dismiss in 3s", ToastLevel.Info);

Disable it:

<ToastContainer ShowProgressBar="false" />

Or per toast:

Toast.Show("No progress bar", ToastLevel.Info, 3000, customIcon: null);

🎨 Theming | Theme | Description | | --- | --- | | Light | Classic white background | | Dark | Dark background | | Minimal | No shadow, no border | | MinimalOutline | Thin outline + colored left border |

Light mode (default)

<ToastContainer Theme="ToastTheme.Light" />

Dark mode

<ToastContainer Theme="ToastTheme.Dark" />

Minimal

<ToastContainer Theme="ToastTheme.Minimal" />

Minimal Outline

<ToastContainer Theme="ToastTheme.MinimalOutline" />

🔥 Levels

Info (blue)

Success (green)

Warning (yellow)

Error (red)

The level automatically controls:

text color

left border color

progress bar color

📍 Positioning

<ToastContainer Position="ToastPosition.BottomRight" />

Available positions:

    TopLeft

    TopRight

    BottomLeft

    BottomRight

⏱ Duration & Progress Bar

ToastService.ShowWarning("Be careful", o => o.Duration = 5000);

Infinite toast:

ToastService.ShowInfo("Always visible", o => o.Duration = -1);

🧩 Custom Icons

ToastService.ShowSuccess("OK", o =>
{
    o.CustomIcon = "<svg ...></svg>";
});

🎬 Animations

Fade

SlideFromRight

SlideFromLeft

SlideFromBottom

Zoom


ToastService.ShowError("Error", o => o.Animation = ToastAnimation.Zoom);

🧪 Demo Project

A full demo project is available on GitHub:

ToastBlazorDemo
https://github.com/alain-mathy/ToastBlazorDemo

Includes:

Basic toast examples

Success / Error / Info / Warning

Theme switching

Positioning

Custom icons

Infinite toasts

Progress bar

Animations

🛣️ Roadmap

[ ] Queued toasts

[ ] Swipe‑to‑dismiss

[ ] Accessibility improvements

🤝 Contributing

Contributions are welcome! Please open an issue or submit a pull request.

📄 License

ToastBlazor is released under the MIT License.

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

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.16 62 4/27/2026
1.0.12 54 4/24/2026
1.0.11 54 4/20/2026
1.0.10 65 4/20/2026
1.0.9 52 4/20/2026
1.0.8 65 4/20/2026
1.0.7 54 4/20/2026
1.0.6 50 4/20/2026
1.0.5 49 4/20/2026
1.0.4 53 4/20/2026
1.0.3 50 4/20/2026
1.0.2 48 4/20/2026
1.0.1 48 4/20/2026
1.0.0 63 4/19/2026