Back to Devexpress

DxTabBase.TabTemplate Property

blazor-devexpress-dot-blazor-dot-base-dot-dxtabbase-89e7f2df.md

latest2.2 KB
Original Source

DxTabBase.TabTemplate Property

Specifies the tab template.

Namespace : DevExpress.Blazor.Base

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

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

Property Value

TypeDescription
RenderFragment

The tab 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 class="purple-tab">Custom Tab</div>
        </TabTemplate>
        <ChildContent>
            <div>This is the first tab</div>
        </ChildContent>
    </DxTabPage>
    <DxTabPage>
        <TabTemplate>
            <div class="gray-tab">Custom Tab</div>
        </TabTemplate>
        <ChildContent>
            <div>This is the second tab</div>
        </ChildContent>
    </DxTabPage>
</DxTabs>
css
.purple-tab {
    padding: 10px 20px; 
    text-align: center; 
    border-radius:7px;
    background-color: rgb(95,54,111); 
    color:white;
}
.gray-tab {
    padding: 10px 20px; 
    text-align: center; 
    border-radius: 7px;
    background-color: rgb(237,237,237); 
    color: black;
}

Run Demo: Tabs

See Also

DxTabBase Class

DxTabBase Members

DevExpress.Blazor.Base Namespace