Table of Contents

Class SnackbarOptions

Namespace
MudBlazor
Assembly
MudBlazor.dll

The options applied to an individual snackbar.

public class SnackbarOptions : CommonSnackbarOptions
Inheritance
SnackbarOptions
Inherited Members
Extension Methods

Constructors

SnackbarOptions(Severity, CommonSnackbarOptions)

Creates new options for a snackbar.

public SnackbarOptions(Severity severity, CommonSnackbarOptions options)

Parameters

severity Severity

The severity of the snackbar to display.

options CommonSnackbarOptions

Any other options to apply.

Properties

Action

The text for a custom button in the snackbar message.

public string? Action { get; set; }

Property Value

string

Remarks

Defaults to null.

ActionColor

The color of the action button.

public Color ActionColor { get; set; }

Property Value

Color

Remarks

Defaults to Default.

ActionVariant

The display variant of the action button.

public Variant? ActionVariant { get; set; }

Property Value

Variant?

Remarks

Defaults to null.

CloseAfterNavigation

Closes the snackbar after navigating away from the current page.

public bool CloseAfterNavigation { get; set; }

Property Value

bool

CloseButtonClickFunc

Occurs when the Close button is clicked.

public Func<Snackbar, Task>? CloseButtonClickFunc { get; set; }

Property Value

Func<Snackbar, Task>

Remarks

Defaults to null.

DuplicatesBehavior

The action applied when duplicate snackbars are detected.

public SnackbarDuplicatesBehavior DuplicatesBehavior { get; set; }

Property Value

SnackbarDuplicatesBehavior

Remarks

Defaults to GlobalDefault which is set via PreventDuplicates.

HideIcon

Hides the icon for the snackbar.

public bool HideIcon { get; set; }

Property Value

bool

Remarks

Defaults to false.

Icon

The custom icon to display for the snackbar.

public string Icon { get; set; }

Property Value

string

Remarks

Defaults to null. Will be set to match the Severity.

IconColor

The color of the icon to display.

public Color IconColor { get; set; }

Property Value

Color

Remarks

Defaults to Inherit.

OnClick

Occurs when the snackbar is clicked.

public Func<Snackbar, Task>? OnClick { get; set; }

Property Value

Func<Snackbar, Task>

Remarks

Defaults to null.

Severity

The severity of the snackbar.

public Severity Severity { get; }

Property Value

Severity

SnackbarTypeClass

The custom CSS classes for the snackbar.

public string? SnackbarTypeClass { get; set; }

Property Value

string

Remarks

Defaults to null. Multiple classes must be separated by spaces.