Toast
Transient notifications surfaced from anywhere via IToastService. Auto-dismiss with severity-based defaults; errors stay sticky.
Severities
Four severities
Info / Success / Warning auto-dismiss; Error is sticky by default.
razor
@inject IToastService Toasts
Toasts.ShowInfo("Working on it…", "We'll let you know when it's ready.");
Toasts.ShowSuccess("Patient saved", "Record #4521 updated.");
Toasts.ShowWarning("Approaching quota", "85% of monthly storage used.");
Toasts.ShowError("Save failed", "Network unreachable. Try again in a moment.");Description & actions
Rich toasts with optional action button
Use ToastOptions for full control over title, description, action callback, and duration.
razor
@inject IToastService Toasts
@* With description *@
Toasts.Show(new ToastOptions
{
Title = "Backup complete",
Description = "All 12,431 records were synced to cloud storage.",
Severity = ToastSeverity.Success
});
@* With action button *@
Toasts.Show(new ToastOptions
{
Title = "Item moved to trash",
Severity = ToastSeverity.Info,
ActionText = "Undo",
OnAction = async () => await RestoreItemAsync()
});