Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxTabBase.TabTemplate Property

Specifies the tab’s template.

Namespace: DevExpress.Blazor.Base

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public RenderFragment TabTemplate { get; set; }

#Property Value

Type Description
RenderFragment

The tab’s template.

#Remarks

The tab template allows you to configure tab appearance. In the following example, tabs have custom appearance and titles. Use the ChildContent property to add content inside your tab page.

Note

Since ChildContent contains nested markup of its parent class, the template content must conform to HTML semantics.

Razor
<DxTabs>
    <DxTabPage>
        <TabTemplate>
            <div style="padding:10px 20px; text-align:center; border-radius:7px;
                 background-color:rgb(95,54,111); color:white">Custom Tab</div>
        </TabTemplate>
        <ChildContent>
            <div>This is the first tab</div>
        </ChildContent>
    </DxTabPage>
    <DxTabPage>
        <TabTemplate>
            <div style="padding:10px 20px; text-align:center; border-radius:7px;
                 background-color:rgb(237,237,237); color:black">Custom Tab</div>
        </TabTemplate>
        <ChildContent>
            <div>This is the second tab</div>
        </ChildContent>
    </DxTabPage>
</DxTabs>

Custom tab appearance

Run Demo: Tabs

See Also