Skip to main content
All docs
V24.1

ToastOptions.SizeMode Property

Specifies the size of the component and its content.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(null)]
public SizeMode? SizeMode { get; set; }

Property Value

Type Default Description
Nullable<SizeMode> null

The size mode. If the property is not specified (the value is null), the size is determined by the DxToastProvider.SizeMode property.

Available values:

Name Description
Small

Small size.

Medium

Medium size.

Large

Large size.

Remarks

The SizeMode property allows you to apply different size modes to the DxToast component. For more information, refer to the following topic: Size Modes.

Toasts in different size modes

<DxToastProvider ThemeMode="ToastThemeMode.Pastel"/>

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

    protected override void OnAfterRender(bool firstRender) {
        ToastService.ShowToast(new ToastOptions() {SizeMode = SizeMode.Small, Text = "Small size mode" });
        ToastService.ShowToast(new ToastOptions() {SizeMode = SizeMode.Medium, Text = "Medium size mode."});
        ToastService.ShowToast(new ToastOptions() {SizeMode = SizeMode.Large, Text = "Large size mode."});
    }
}

Run Demo: Toast Notification - Overview

See Also