DxToast.ShowIcon Property
Specifies whether to show an icon in the toast notification.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.1.dll
NuGet Package: DevExpress.Blazor
Declaration
[DefaultValue(true)]
[Parameter]
public bool ShowIcon { get; set; }
Property Value
Type | Default | Description |
---|---|---|
Boolean | true |
|
Remarks
A toast notification displays a predefined icon. Set the ShowIcon
property to false
to hide the icon. If the ShowIcon
property is not specified, icon visibility is determined by the DxToastProvider.ShowIcon property.
Use the IconCssClass property to customize icon settings or display a custom icon.
<DxButton RenderStyle="ButtonRenderStyle.Secondary" Text="Show a toast" Click="ShowToasts" />
<DxToastProvider ThemeMode="ToastThemeMode.Pastel" />
<DxToast Id="Toast1" Text="Predefined icon." />
<DxToast Id="Toast2" Text="Custom icon." IconCssClass="oi oi-task" />
<DxToast Id="Toast3" Text="No icon." ShowIcon="false" />
@code {
[Inject] IToastNotificationService ToastService { get; set; }
private void ShowToasts() {
ToastService.ShowToast("Toast1");
ToastService.ShowToast("Toast2");
ToastService.ShowToast("Toast3");
}
}
See Also