Tabs

Switchable content panels — tabs, pills or underline style, with icons, badges, subtitles and hash navigation.

Tabs

TabAreaBuilder.Tabs() renders the classic Bootstrap tab navigation. Active() sets the initially selected panel; Disabled() prevents a tab from being clicked.

Tabs

Understanding your goals, constraints and audience before writing a single line of code.

Wireframes, prototypes and a visual language aligned with your brand.

Clean, well-tested code delivered in regular sprints.

This tab is disabled — it cannot be selected.

C#
@using DMBBootstrapBuilder
@using DMBPageBuilder
@using (Html.TabAreaBuilder().Tabs().WithContentClasses("pt-3").Begin())
{
    @using (Html.TabBlockBuilder().WithTitle("Discovery").WithIcon(IconStruct.Bootstrap("bi-search")).Active().Begin())
    {
        @using (Html.PB_P().AsMuted().Begin())
        {
            @:Understanding your goals, constraints and audience before writing a single line of code.
        }
    }
    @using (Html.TabBlockBuilder().WithTitle("Design").WithIcon(IconStruct.Bootstrap("bi-pencil-square")).Begin())
    {
        @using (Html.PB_P().AsMuted().Begin())
        {
            @:Wireframes, prototypes and a visual language aligned with your brand.
        }
    }
    @using (Html.TabBlockBuilder().WithTitle("Development").WithIcon(IconStruct.Bootstrap("bi-code-slash")).Begin())
    {
        @using (Html.PB_P().AsMuted().Begin())
        {
            @:Clean, well-tested code delivered in regular sprints.
        }
    }
    @using (Html.TabBlockBuilder().WithTitle("Launch").WithIcon(IconStruct.Bootstrap("bi-rocket-takeoff")).Disabled().Begin())
    {
        @using (Html.PB_P().AsMuted().Begin())
        {
            @:This tab is disabled — it cannot be selected.
        }
    }
}

Pills

TabAreaBuilder.Pills() renders pill-shaped navigation buttons instead of the classic underlined tabs.

Pills

High-level summary of the project status and key metrics.

Members and their current assignments.

Subscription plan and payment history.

C#
@using DMBBootstrapBuilder
@using DMBPageBuilder
@using (Html.TabAreaBuilder().Pills().WithNavClasses("mb-3").Begin())
{
    @using (Html.TabBlockBuilder().WithTitle("Overview").WithIcon(IconStruct.Bootstrap("bi-bar-chart")).Active().Begin())
    {
        @using (Html.PB_P().AsMuted().Begin())
        {
            @:High-level summary of the project status and key metrics.
        }
    }
    @using (Html.TabBlockBuilder().WithTitle("Team").WithIcon(IconStruct.Bootstrap("bi-people")).Begin())
    {
        @using (Html.PB_P().AsMuted().Begin())
        {
            @:Members and their current assignments.
        }
    }
    @using (Html.TabBlockBuilder().WithTitle("Billing").WithIcon(IconStruct.Bootstrap("bi-credit-card")).Begin())
    {
        @using (Html.PB_P().AsMuted().Begin())
        {
            @:Subscription plan and payment history.
        }
    }
}

Underline

TabAreaBuilder.Underline() renders a minimal underline indicator with no background fill on the active tab.

Underline

Latest updates and announcements from the team.

Usage statistics and performance indicators.

Changelog and past activity log.

C#
@using DMBBootstrapBuilder
@using DMBPageBuilder
@using (Html.TabAreaBuilder().Underline().WithContentClasses("pt-3").Begin())
{
    @using (Html.TabBlockBuilder().WithTitle("News").Active().Begin())
    {
        @using (Html.PB_P().AsMuted().Begin())
        {
            @:Latest updates and announcements from the team.
        }
    }
    @using (Html.TabBlockBuilder().WithTitle("Stats").Begin())
    {
        @using (Html.PB_P().AsMuted().Begin())
        {
            @:Usage statistics and performance indicators.
        }
    }
    @using (Html.TabBlockBuilder().WithTitle("History").Begin())
    {
        @using (Html.PB_P().AsMuted().Begin())
        {
            @:Changelog and past activity log.
        }
    }
}

Fill & Justified

Fill() stretches each tab to fill available width proportionally. Justified() gives every tab an equal width.

Fill & justified

Fill()

Alpha panel content.

Beta panel content.

Gamma panel content.

Justified()

Alpha panel content.

Beta panel content.

Gamma panel content.

C#
@using DMBBootstrapBuilder
@using DMBPageBuilder
@using (Html.RowBuilder().Begin())
{
    @using (Html.ColBuilder().SetCol(ColSize.Col12).SetCol(ColSize.Col6, ResponsiveBreakpoint.Md).Begin())
    {
        @using (Html.BlockBuilder().AsSectionSubLabel().Begin())
        {
            @Html.TitleBuilder().SetTitle("Fill()", TitleLevel.Six).AsSubSectionTitle().Render()
        }
        @using (Html.TabAreaBuilder().Tabs().Fill().WithContentClasses("pt-3").Begin())
        {
            @using (Html.TabBlockBuilder().WithTitle("Alpha").Active().Begin())
            {
                @using (Html.PB_P().AsMuted().Begin())
                {
                    @:Alpha panel content.
                }
            }
            @using (Html.TabBlockBuilder().WithTitle("Beta").Begin())
            {
                @using (Html.PB_P().AsMuted().Begin())
                {
                    @:Beta panel content.
                }
            }
            @using (Html.TabBlockBuilder().WithTitle("Gamma").Begin())
            {
                @using (Html.PB_P().AsMuted().Begin())
                {
                    @:Gamma panel content.
                }
            }
        }
    }
    @using (Html.ColBuilder().SetCol(ColSize.Col12).SetCol(ColSize.Col6, ResponsiveBreakpoint.Md).Begin())
    {
        @using (Html.BlockBuilder().AsSectionSubLabel().Begin())
        {
            @Html.TitleBuilder().SetTitle("Justified()", TitleLevel.Six).AsSubSectionTitle().Render()
        }
        @using (Html.TabAreaBuilder().Pills().Justified().WithContentClasses("pt-3").Begin())
        {
            @using (Html.TabBlockBuilder().WithTitle("Alpha").Active().Begin())
            {
                @using (Html.PB_P().AsMuted().Begin())
                {
                    @:Alpha panel content.
                }
            }
            @using (Html.TabBlockBuilder().WithTitle("Beta").Begin())
            {
                @using (Html.PB_P().AsMuted().Begin())
                {
                    @:Beta panel content.
                }
            }
            @using (Html.TabBlockBuilder().WithTitle("Gamma").Begin())
            {
                @using (Html.PB_P().AsMuted().Begin())
                {
                    @:Gamma panel content.
                }
            }
        }
    }
}

Badges & Subtitles

AddBadge(string, VariantStyle) adds a count chip to the tab header. WithSubtitle(string) adds a secondary label below the title.

Badges & subtitles

12 unread messages waiting for your attention.

4 pending tasks assigned to you.

28 items completed this month.

C#
@using DMBBootstrapBuilder
@using DMBPageBuilder
@using (Html.TabAreaBuilder().Underline().WithContentClasses("pt-3").Begin())
{
    @using (Html.TabBlockBuilder().WithTitle("Inbox").WithSubtitle("Unread").WithIcon(IconStruct.Bootstrap("bi-inbox")).AddBadge("12", VariantStyle.Danger).Active().Begin())
    {
        @using (Html.PB_P().AsMuted().Begin())
        {
            @:12 unread messages waiting for your attention.
        }
    }
    @using (Html.TabBlockBuilder().WithTitle("Tasks").WithSubtitle("In progress").WithIcon(IconStruct.Bootstrap("bi-list-check")).AddBadge("4", VariantStyle.Warning).Begin())
    {
        @using (Html.PB_P().AsMuted().Begin())
        {
            @:4 pending tasks assigned to you.
        }
    }
    @using (Html.TabBlockBuilder().WithTitle("Done").WithSubtitle("Completed").WithIcon(IconStruct.Bootstrap("bi-check-circle")).AddBadge("28", VariantStyle.Success).Begin())
    {
        @using (Html.PB_P().AsMuted().Begin())
        {
            @:28 items completed this month.
        }
    }
}

Hash Navigation

EnableHashNavigation() activates a tab from the URL hash on load. UpdateHashOnTabChange() keeps the URL in sync as the user navigates.

Hash navigation

Active by default. The URL hash becomes #hash-tabs_tab_0_pane when this tab is selected.

Activated via window.location.hash — the hash updates to #hash-tabs_tab_1_pane.

Direct links can target this pane — hash becomes #hash-tabs_tab_2_pane.

C#
@using DMBBootstrapBuilder
@using DMBPageBuilder
@using (Html.TabAreaBuilder().SetId("hash-tabs").Tabs().EnableHashNavigation(true).UpdateHashOnTabChange(true).WithContentClasses("pt-3").Begin())
{
    @using (Html.TabBlockBuilder().WithTitle("Overview").WithIcon(IconStruct.Bootstrap("bi-house")).Active().Begin())
    {
        @using (Html.PB_P().AsMuted().Begin())
        {
            @:Active by default. The URL hash becomes #hash-tabs_tab_0_pane when this tab is selected.
        }
    }
    @using (Html.TabBlockBuilder().WithTitle("Monitoring").WithIcon(IconStruct.Bootstrap("bi-activity")).Begin())
    {
        @using (Html.PB_P().AsMuted().Begin())
        {
            @:Activated via window.location.hash — the hash updates to #hash-tabs_tab_1_pane.
        }
    }
    @using (Html.TabBlockBuilder().WithTitle("Billing").WithIcon(IconStruct.Bootstrap("bi-credit-card")).Begin())
    {
        @using (Html.PB_P().AsMuted().Begin())
        {
            @:Direct links can target this pane — hash becomes #hash-tabs_tab_2_pane.
        }
    }
}