Back to Devexpress

DxToast.Template Property

blazor-devexpress-dot-blazor-dot-dxtoast-dadb21f6.md

latest1.7 KB
Original Source

DxToast.Template Property

Specifies the template displayed in the toast notification.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[Parameter]
public RenderFragment Template { get; set; }

Property Value

TypeDescription
RenderFragment

Template content.

|

Remarks

Use the Template property to add custom content to the toast notification. The specified render fragment is displayed under toast title and text content.

Alternatively, you can specify a template as the component’s ChildContent (see approach 2).

razor
<DxToast @ref=toastButtons Title="Toast with buttons">
    <Template>
        <DxButton CssClass="mx-2">button 1</DxButton>
        <DxButton RenderStyleMode="ButtonRenderStyleMode.Outline">button 2</DxButton>
    </Template>
</DxToast>
razor
<DxToast @ref=toastButtons Title="Toast with buttons">
    <DxButton CssClass="mx-2">button 1</DxButton>
    <DxButton RenderStyleMode="ButtonRenderStyleMode.Outline">button 2</DxButton>
</DxToast>

See Also

DxToast Class

DxToast Members

DevExpress.Blazor Namespace