ComponentsFeedback and overlays
Snackbar
Snackbars confirm what just happened with a brief message at the edge of the screen, optionally with one action such as Undo. Choose them for transient news; use an alert for messages that must stay.
Severities
Inject ISnackbar and call Add. Severity picks the icon and color; a MudSnackbarProvider in the layout renders the stack.
Every severity and variant
SnackbarVariant is set per message through the configure callback. Each button shows that combination.
| Severity ↓ · Variant → | Text | Filled | Outlined |
|---|---|---|---|
| Normal | |||
| Info | |||
| Success | |||
| Warning | |||
| Error |
Positions
In MudBlazor 9.11 the position belongs to the shared Configuration, not to a single message, so this example clears the stack, moves it, and restores the app's position when you leave the page.
Actions and rich content
Action adds a button and OnClick runs when it is pressed: the classic Undo. A RenderFragment message can contain markup.
Harbour Street
Museum Quarter
North Station
Duplicates and keys
A key identifies a message. DuplicatesBehavior decides whether a second message with the same key appears; RemoveByKey and Clear take messages away.
Close icons, duration and interaction
RequireInteraction keeps a message until it is dismissed; VisibleStateDuration sets how long the others stay. Icons can be replaced or hidden.
Playground
Configure a message and show it; the call below updates with only the options that differ from the defaults.
Snackbar.Add("Seat 14B is reserved for you.", Severity.Success, options =>
{
options.SnackbarVariant = Variant.Outlined;
});