Skip to main content
All docs
V24.1

DxToast.DisplayTime Property

Specifies how long the toast is visible.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(null)]
[Parameter]
public TimeSpan? DisplayTime { get; set; }

Property Value

Type Default Description
Nullable<TimeSpan> null

The time span;
null to derive the value from the toast provider;
0 to disable toast auto-hide.

Remarks

Use the DisplayTime property to specify the time span after which the toast disappears. If the property is not specified, the display time is determined by the DxToastProvider.DisplayTime property (5 seconds by default).

Set the DisplayTime property to 0 (zero) to leave the message visible until it is forced closed.

<DxButton RenderStyle="ButtonRenderStyle.Secondary" Text="Show toast notification" Click="ShowToast" />
<DxButton RenderStyle="ButtonRenderStyle.Secondary" Text="Close toast notification" Click="CloseToast" />
<DxToastProvider />

<DxToast @ref=toast
          DisplayTime="@TimeSpan.Zero"
          Title="Notification"
          Text="The process is completed." />
@code {
    DxToast toast;
    private void ShowToast() {
        toast.Show();
    }
    private void CloseToast() {
        toast.Close();
    }
}
See Also