Search Documentation

Search for pages and headings in the documentation

Creating Tabs

Tabs are top-level navigation elements that split your documentation into separate sections. Think of tabs as completely independent view modes.

What Are Tabs?

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Getting Started β”‚  API  β”‚ Guides β”‚  <- Tabs
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Sidebar Content for selected tab β”‚
β”‚                                  β”‚
β”‚ Current tab: Getting Started     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Clicking a tab switches the entire sidebar navigation.

Creating Your First Tab

Step 1: Define in Configuration

export const SIDEBAR_NAVIGATION = {
    docs: {
        defaultTab: {
            label: "Getting Started",
            icon: "πŸš€",
        },
        groups: [
            {
                id: "quickstart",
                label: "Quick Start",
                tab: true, // <- This makes it a tab!
                autoGenerated: true,
            },
            {
                id: "guides",
                label: "How-To Guides",
                tab: true, // <- Another tab
                autoGenerated: true,
            },
            {
                id: "reference",
                label: "Reference",
                tab: true, // <- Third tab
                autoGenerated: true,
            },
        ],
    },
};

Key: Set tab: true to promote a group to a tab.

Step 2: Create Folder Structure

content/docs/
β”œβ”€ quickstart/           <- Matches "quickstart" tab
β”‚  β”œβ”€ intro.md
β”‚  β”œβ”€ setup.md
β”‚  └─ first-app.md
β”œβ”€ guides/               <- Matches "guides" tab
β”‚  β”œβ”€ authentication.md
β”‚  β”œβ”€ database.md
β”‚  └─ deployment.md
└─ reference/            <- Matches "reference" tab
   β”œβ”€ api.md
   β”œβ”€ cli.md
   └─ config.md

Step 3: User Experience

Users see tabs:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Quickstart β”‚ Guides β”‚ Reference β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Content below changes based on selected tab.

On Quickstart tab:
β”œβ”€ Introduction
β”œβ”€ Setup
└─ First App

On Guides tab:
β”œβ”€ Authentication
β”œβ”€ Database
└─ Deployment

On Reference tab:
β”œβ”€ API
β”œβ”€ CLI
└─ Config

Clicking tabs switches navigation entirely.

Tab with Nested Groups

Tabs can contain groups (creating another level of navigation):

{
    id: "api",
    label: "API",
    tab: true,
    groups: [
        {
            id: "authentication",
            label: "Authentication",
            autoGenerated: true,
        },
        {
            id: "resources",
            label: "Resources",
            groups: [
                { id: "users", label: "Users", autoGenerated: true },
                { id: "posts", label: "Posts", autoGenerated: true },
                { id: "comments", label: "Comments", autoGenerated: true },
            ],
        },
        {
            id: "errors",
            label: "Error Handling",
            autoGenerated: true,
        },
    ],
}

Navigation:

Tabs: [Quickstart] [API] [Reference]

When on API tab, sidebar shows:
β”œβ”€ Authentication
β”œβ”€ Resources
β”‚  β”œβ”€ Users
β”‚  β”œβ”€ Posts
β”‚  └─ Comments
└─ Error Handling

Tabs + nested groups = powerful organization.

Tab Icons

Icons help users identify tabs quickly:

defaultTab: {
    label: "Getting Started",
    icon: "πŸš€",  // <- Rocket for quick start
},
groups: [
    {
        id: "getting-started",
        label: "Getting Started",
        tab: true,
        icon: "πŸ“–",  // <- Book icon
    },
    {
        id: "api",
        label: "API Reference",
        tab: true,
        icon: "πŸ”—",  // <- Link icon
    },
    {
        id: "examples",
        label: "Examples",
        tab: true,
        icon: "πŸ’‘",  // <- Lightbulb icon
    },
],

Icons appear with tab labels. Users recognize patterns:

  • πŸš€ Getting Started
  • πŸ”— API
  • πŸ’‘ Examples
  • βš™οΈ Configuration
  • πŸ› οΈ Advanced

Tab Selection State

Tabs remember selection. If user navigates to:

/docs/api/endpoints

And selects β€œReference” tab, sidebar updates but URL pattern changes:

/docs/reference/overview

Breadcrumb updates:

Before: Home > Docs > API > Endpoints
After:  Home > Docs > Reference > Overview

Each tab maintains its own content and breadcrumb trail.

Common Tab Structures

Structure 1: By User Journey

Getting Started -> Learn -> Build -> Deploy -> Reference
groups: [
    { id: "getting-started", label: "Getting Started", tab: true, ... },
    { id: "learn", label: "Learn", tab: true, ... },
    { id: "build", label: "Build", tab: true, ... },
    { id: "deploy", label: "Deploy", tab: true, ... },
    { id: "reference", label: "Reference", tab: true, ... },
]

New users start with β€œGetting Started” tab. Advanced users jump to β€œReference” tab.

Structure 2: By Audience

Users | Developers | Operators
groups: [
    { id: "users", label: "Users", tab: true, ... },
    { id: "developers", label: "Developers", tab: true, ... },
    { id: "operators", label: "Operators", tab: true, ... },
]

Each audience sees relevant content in their tab.

Structure 3: By Product

Core | Extensions | Plugins | Marketplace
groups: [
    { id: "core", label: "Core", tab: true, ... },
    { id: "extensions", label: "Extensions", tab: true, ... },
    { id: "plugins", label: "Plugins", tab: true, ... },
    { id: "marketplace", label: "Marketplace", tab: true, ... },
]

Each product/feature gets its own tab.

Structure 4: By Version

v3 (Current) | v2 (LTS) | v1 (Legacy)
groups: [
    { id: "v3-current", label: "v3 (Current)", tab: true, ... },
    { id: "v2-lts", label: "v2 (LTS)", tab: true, ... },
    { id: "v1-legacy", label: "v1 (Legacy)", tab: true, ... },
]

Users select their version, see relevant docs.

Switching Between Tabs

Manual Tab Click

User clicks β€œAPI” tab -> sidebar changes -> breadcrumb updates -> URL changes.

Was viewing: /docs/guides/authentication
Clicked: API tab
Now viewing: /docs/api/overview (or defaultTab for API)

Default Tab

If user visits /docs/ (no specific page), they see:

defaultTab: { label: "Getting Started", icon: "πŸš€" }

They land on Getting Started tab’s first page.

Deep Linking

Users can share direct links to specific tabs:

/docs/api/endpoints -> Opens API tab, shows endpoints
/docs/guides/setup -> Opens Guides tab, shows setup
/docs/reference/config -> Opens Reference tab, shows config

Clicking those links automatically switches to correct tab.

Tab + Manual Control

Mix tabs with manual entries:

groups: [
    {
        id: "essentials",
        label: "Essentials",
        tab: true,
        autoGenerated: false,
        entries: [
            { slug: "essentials/why-choose-us" },
            { slug: "essentials/features" },
            { slug: "essentials/pricing" },
        ],
    },
    {
        id: "guides",
        label: "Guides",
        tab: true,
        autoGenerated: true, // Auto-discover all files
    },
    {
        id: "api",
        label: "API",
        tab: true,
        autoGenerated: false,
        entries: [{ slug: "api/authentication" }, { slug: "api/endpoints" }],
    },
];

Result:

  • Essentials tab: 3 specific pages only
  • Guides tab: all files appear automatically
  • API tab: only listed endpoints appear

Performance Notes

Each tab loads sidebar content separately:

  • First load: Tab 1 loads
  • Click Tab 2: Tab 2’s sidebar loads (lazy)
  • Click Tab 3: Tab 3’s sidebar loads (lazy)

No performance impact from multiple tabs.

Responsive Behavior

On mobile, tabs stack or become dropdowns:

Desktop (3+ tabs):
[Getting Started] [API] [Reference] [Advanced]

Tablet (2-3 tabs):
[Getting Started] [API] [Reference] [β–Ό More]

Mobile (1+ tab):
Getting Started β–Ό  (dropdown)

Users can still access all tabs on mobile via dropdown.

Migration: Groups to Tabs

Converting existing groups to tabs:

Before (No tabs)

groups: [
    { id: "intro", label: "Introduction", autoGenerated: true },
    { id: "guides", label: "Guides", autoGenerated: true },
    { id: "reference", label: "Reference", autoGenerated: true },
];

Sidebar shows 3 groups, all in same view.

After (With tabs)

groups: [
    { id: "intro", label: "Introduction", tab: true, autoGenerated: true },
    { id: "guides", label: "Guides", tab: true, autoGenerated: true },
    { id: "reference", label: "Reference", tab: true, autoGenerated: true },
];

Same content, now organized with tabs. Just add tab: true.

Next Steps