Search Documentation

Search for pages and headings in the documentation

Understanding Tabs

Tabs are top-level navigation contexts. When you click a tab, the entire sidebar switches to show that tab’s content. Tabs are perfect for organizing major documentation sections.

What are Tabs?

A tab is a promoted group that appears at the top of the sidebar:

[Learn] [Getting Started] [API Reference] [Guides]  <- Tabs
β”œβ”€β”€ Group 1
β”œβ”€β”€ Group 2
└── Group 3

Clicking a tab switches which groups appear below.

Tabs vs. Groups

AspectGroupsTabs
LocationAppear as sidebar sectionsAppear at top as clickable buttons
NavigationExpand/collapseComplete sidebar switch
HierarchyOrganized within each otherTop-level only
Use CaseOrganize entriesSeparate major sections

Creating Tabs

To make a group a tab, add tab: true:

{
    id: "api",
    label: "API Reference",
    icon: "πŸ“–",
    tab: true,  // <- Makes this a tab
    groups: [
        {
            id: "endpoints",
            label: "Endpoints",
            autoGenerated: true,
        },
        {
            id: "authentication",
            label: "Authentication",
            entries: [
                { slug: "api/auth/oauth" },
                { slug: "api/auth/jwt" },
            ],
        },
    ],
}

Sidebar renders as:

[Learn] [API Reference]  <- Now it's a tab!

When "API Reference" tab is active:
β”œβ”€β”€ Endpoints
└── Authentication
    β”œβ”€β”€ OAuth
    └── JWT

The Default Tab

Non-tabbed groups appear in a special β€œdefault” tab. Configure it in the defaultTab property:

export const SIDEBAR_NAVIGATION = {
    "my-docs": {
        defaultTab: {
            label: "Learn", // Label for the default tab
            icon: "πŸ“–", // Icon for the default tab
        },
        groups: [
            // Non-tabbed groups appear in the default tab
            {
                id: "getting-started",
                label: "Getting Started",
                // No tab: true, so appears in default tab
            },
            // This one becomes a separate tab
            {
                id: "api",
                label: "API Reference",
                tab: true,
            },
        ],
    },
};

Sidebar renders as:

[Learn] [API Reference]  <- Two tabs
     ↓
When "Learn" tab is active:
β”œβ”€β”€ Getting Started
    β”œβ”€β”€ Introduction
    β”œβ”€β”€ Installation
    └── Quick Start

When "API Reference" tab is active:
β”œβ”€β”€ Endpoints
β”œβ”€β”€ Authentication
└── Rate Limiting

Multiple Tabs

You can have multiple tabs. They appear left-to-right in order:

groups: [
    {
        id: "guides",
        label: "Guides",
        tab: true,
        autoGenerated: true,
    },
    {
        id: "api",
        label: "API Reference",
        tab: true,
        autoGenerated: true,
    },
    {
        id: "patterns",
        label: "Common Patterns",
        tab: true,
        autoGenerated: true,
    },
];

Sidebar renders as:

[Guides] [API Reference] [Common Patterns]
    ↑ First tab  ↑ Second tab   ↑ Third tab

Tabs with Nested Groups

Tabs can contain complex hierarchies with nested groups:

{
    id: "documentation",
    label: "Documentation",
    icon: "πŸ“š",
    tab: true,
    groups: [
        {
            id: "getting-started",
            label: "Getting Started",
            entries: [
                { slug: "documentation/getting-started/installation" },
                { slug: "documentation/getting-started/quick-start" },
            ],
        },
        {
            id: "advanced",
            label: "Advanced Topics",
            groups: [
                {
                    id: "architecture",
                    label: "Architecture",
                    autoGenerated: true,
                },
                {
                    id: "performance",
                    label: "Performance Tuning",
                    autoGenerated: true,
                },
            ],
        },
    ],
}

Sidebar when β€œDocumentation” tab is active:

πŸ“š Documentation
β”œβ”€β”€ Getting Started
β”‚   β”œβ”€β”€ Installation
β”‚   └── Quick Start
└── Advanced Topics
    β”œβ”€β”€ Architecture
    └── Performance Tuning

Real-World Example: This Site

This site showcases tabs with nested groups:

Navigation System (Tab)
β”œβ”€β”€ Core Concepts
β”‚   β”œβ”€β”€ Entries
β”‚   β”œβ”€β”€ Groups
β”‚   β”œβ”€β”€ Nested Groups
β”‚   └── Tabs          <- You're reading this!
β”œβ”€β”€ Hierarchy

Configuration (Tab)
β”œβ”€β”€ Basics
β”œβ”€β”€ Advanced
    β”œβ”€β”€ Nested Setup
    └── Tab Management

Generation Strategies (Tab)
β”œβ”€β”€ Auto-Generation
β”œβ”€β”€ Manual Creation
└── Hybrid Approach

Each major section is a tab. When you click a tab, the sidebar switches to show its content.

When to Use Tabs

βœ… Multiple major sections: Documentation vs. API reference βœ… Different audiences: User guides vs. Developer guides βœ… Product versions: v1 vs. v2 vs. v3 βœ… Multiple collections worth highlighting

Tab Limitations

  • Tabs are only top-level (you can’t nest tabs within tabs)
  • Too many tabs (5+) clutters the interface
  • Not recommended for simple documentation

Next Steps

Learn about: