New to Telerik UI for .NET MAUIStart a free 30-day trial

.NET MAUI TabView Header Item Styling

The TabView control provides the built-in HeaderItemStyle property, which allows you to apply styling properties to the TabViewHeaderItem.

The following table summarizes the properties that you can apply to the TabViewHeaderItem:

PropertyDescription
BackgroundColorSpecifies the background color of the header item.
BorderColorSpecifies the border color of the header item.
BorderThicknessSpecifies the border thickness of the header item.
CornerRadiusSpecifies the corner radius of the header item.
ContentPaddingSpecifies the padding of the inner content of the header item.
TextColorSpecifies the color of the text in the header item.
FontFamilySpecifies the font family of the text in the header item.
FontSizeSpecifies the font size of the text in the header item.
FontAttributesSpecifies the font attributes of the text in the header item.
TextDecorationsSpecifies the decorations of the text in the header item.
HorizontalTextAlignmentSpecifies the horizontal alignment of the text in the header item.
VerticalTextAlignmentSpecifies the vertical alignment of the text in the header item.
ImageSourceSpecifies the source of the image icon in the header item.
ImageAspectSpecifies the aspect of the image icon in the header item.
ImageWidthSpecifies the width of the image icon in the header item.
ImageHeightSpecifies the height of the image icon in the header item.
ImageSpacingSpecifies the spacing between the image icon and the text in the header item.
ImagePositionSpecifies the position of the image icon relative to the text (Left, Top, Right, and Bottom).

The example below shows how to style the header item of the TabView:

xaml
<telerik:RadTabView x:Name="tabView">
    <telerik:RadTabView.HeaderItemStyle>
        <Style TargetType="telerik:TabViewHeaderItem">
            <Setter Property="FontAttributes" Value="Italic"/>
            <Setter Property="TextColor" Value="#99000000" />
            <Setter Property="VisualStateManager.VisualStateGroups">
                <VisualStateGroupList>
                    <VisualStateGroup Name="CommonStates">
                        <VisualState Name="Normal" />
                        <VisualState Name="Disabled">
                            <VisualState.Setters>
                                <Setter Property="TextColor" Value="#61000000" />
                            </VisualState.Setters>
                        </VisualState>
                        <VisualState Name="Selected">
                            <VisualState.Setters>
                                <Setter Property="TextColor" Value="#e05194" />
                                <Setter Property="BorderColor" Value="#e05194" />
                            </VisualState.Setters>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateGroupList>
            </Setter>
        </Style>
    </telerik:RadTabView.HeaderItemStyle>
    <telerik:TabViewItem HeaderText="Home">
        <Label Margin="10" Text="This is the content of the Home tab" />
    </telerik:TabViewItem>
    <telerik:TabViewItem HeaderText="Folder">
        <Label Margin="10" Text="This is the content of the Folder tab" />
    </telerik:TabViewItem>
    <telerik:TabViewItem HeaderText="View">
        <Label Margin="10" Text="This is the content of the View tab" />
    </telerik:TabViewItem>
</telerik:RadTabView>

The example produces the following result:

.NET MAUI TabView Header Item Style

For a runnable example with the TabView HeaderItemStyle scenario, see the SDKBrowser Demo Application and go to TabView > Styling.

See Also

In this article
See Also
Not finding the help you need?
Contact Support