Basic Tabs

<PrimerTab OnTabSelected="OnTabSelected" Selected="code">
    <PrimerTabItem Label="Code" Value="code" />
    <PrimerTabItem Label="Issues" Value="issues" Counter="42" />
    <PrimerTabItem Label="Pull Requests" Value="prs" />
    <PrimerTabItem Value="projects" Label="Projects">
        <Icon>
            <PrimerIcon Icon="IconName.Project16" Size="IconSize.Small" />
        </Icon>
    </PrimerTabItem>
    <PrimerTabItem Label="Actions" Value="actions" />
</PrimerTab>

Tab Component Options

Available options for Tab and TabItem components

NameDescriptionDefault ValueCSS Class
Label
Tab text label
-
-
Value
Unique value associated with the tab
-
-
Counter
Optional counter badge
null
Counter
Icon
Optional icon next to label
null
-
Selected
Initially selected tab value
null
-
OnTabSelected
Callback when a tab is selected
-
-
void OnTabSelected(string selectedTab)
{
    Console.WriteLine($"Selected tab: {selectedTab}");
}