Toast Notifications
Imperative toast system with auto-dismiss, stacking, and full ARIA accessibility.
Setup
// Program.cs
builder.Services.AddScoped<ToastService>();
// MainLayout.razor
<HelixToastContainer Position="ToastPosition.TopRight" />
Show Toasts
@inject ToastService ToastService
ToastService.ShowInfo("Processing...");
ToastService.ShowSuccess("File uploaded!");
ToastService.ShowWarning("Storage almost full.");
ToastService.ShowError("Connection lost.");
// With title
ToastService.ShowSuccess("Your changes were saved.", "Saved!");
// Custom duration (0 = no auto-dismiss)
ToastService.ShowError("Critical error", duration: 0);
Dismiss
var id = ToastService.ShowInfo("Processing...");
ToastService.Dismiss(id); // Dismiss one
ToastService.DismissAll(); // Clear all
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
Position | ToastPosition | TopRight | Screen position |
MaxVisible | int | 5 | Max toasts before oldest dismissed |
Live Demo
Toast Notifications Demo
Open in new tab ↗
Interactive demo coming soon
Try locally with: dotnet run --project samples/Arcadia.Demo.Server Loading Blazor demo...