Skip to main content
All docs
V24.1

ToastOptions.IconCssClass Property

Specifies the name of the CSS class applied to the toast notification icon.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(null)]
public string IconCssClass { get; set; }

Property Value

Type Default Description
String null

The CSS class name.

Remarks

A toast notification displays a predefined icon. Use the IconCssClass property to customize icon settings or display a custom icon. Set the ShowIcon property to false to hide the icon.

DevExpress Blazor components support pre-defined icon sets (such as Iconic or Bootstrap-recommended libraries) and custom icon libraries. Refer to the following topic for more information: Icons.

<DxButton Text="Show a toast" Click="CreateToasts" />
<DxToastProvider ThemeMode="ToastThemeMode.Pastel" />

@code {
    [Inject] IToastNotificationService ToastService { get; set; }

    private void CreateToasts() {
        ToastService.ShowToast(new ToastOptions {
            Text = "Predefined icon.",
        });
        ToastService.ShowToast(new ToastOptions {
            Text = "Custom icon.",
            IconCssClass = "oi oi-task"
        });
        ToastService.ShowToast(new ToastOptions {
            Text = "No icon.",
            ShowIcon = false
        });
    }
}

Toasts with default and custom icons

See Also