Skip to main content
A newer version of this page is available. .

DxTabBase.TextTemplate Property

Specifies the template used to display the tab’s text.

Namespace: DevExpress.Blazor.Base

Assembly: DevExpress.Blazor.v22.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public RenderFragment TextTemplate { get; set; }

Property Value

Type Description
RenderFragment

The template content.

Remarks

Use the TextTemplate property to apply a template for the tab’s text.

In the following example, the template contains a button that removes a tab:

<DxTabs>
    @foreach(var tab in TabList) {
        <DxTab>
            <TextTemplate>
                <div>
                    @tab
                    <DxButton IconCssClass="oi oi-circle-x"
                              RenderStyle="ButtonRenderStyle.Link"
                              RenderStyleMode="ButtonRenderStyleMode.Text"
                              CssClass="shadow-none"
                              Click="()=>RemoveTab(tab)" />
                </div>
            </TextTemplate>
        </DxTab>
    }
</DxTabs>

@code {
    List<string> TabList = new List<string> { "Required Information", "Additional Information" };
    void RemoveTab(string tab) {
        TabList.Remove(tab);
    }
}

Tabs - TextTemplate

View Example: Add Close Tab Buttons

See Also