Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ToastOptions Class

Defines options for a toast notification.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public class ToastOptions

#Remarks

The ToastOptions object allows you to set up toast settings when you create a toast notification at runtime.

Run Demo: Toast Customization

razor
<style>
    .italic-text {
        font-style: italic;
        text-align: center;
    }
</style>

<DxButton Text="Show a toast" Click="CreateToastAtRuntime" />
<DxToastProvider />

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

    private void CreateToastAtRuntime() {
        ToastService.ShowToast(new ToastOptions {
            Title = "Notification",
            Text = "The process is completed.",
            ShowIcon = false,
            CssClass = "italic-text",
            ThemeMode = ToastThemeMode.Pastel,
            ShowCloseButton = false,
        });
    }
}

Customized toast notification

#Inheritance

Object
ToastOptions
See Also