Search Documentation

Search for pages and headings in the documentation

Single-Level Nesting

Single-level nesting is when groups contain other groupsβ€”but only one layer deep. Perfect for most documentation needs.

Basic Concept

Tab or Root Level
β”œβ”€β”€ Group 1
β”‚   β”œβ”€β”€ Entry 1
β”‚   β”œβ”€β”€ Entry 2
β”‚   └── Entry 3
β”œβ”€β”€ Group 2
β”‚   β”œβ”€β”€ Entry 1
β”‚   └── Entry 2
└── Group 3
    β”œβ”€β”€ Entry 1
    β”œβ”€β”€ Entry 2
    β”œβ”€β”€ Entry 3
    └── Entry 4

Think: Category -> Subcategory -> Pages

Configuration Example

export const SIDEBAR_NAVIGATION = {
    "new-docs": {
        defaultTab: { label: "Overview", icon: "πŸ“š" },
        groups: [
            {
                id: "core",
                label: "Core Concepts",
                groups: [
                    // <- Single-level nesting
                    {
                        id: "entries",
                        label: "Understanding Entries",
                        autoGenerated: false,
                        entries: [
                            { slug: "core-concepts/entries/what-are-entries" },
                            { slug: "core-concepts/entries/folder-vs-manual" },
                        ],
                    },
                    {
                        id: "groups",
                        label: "Understanding Groups",
                        autoGenerated: true, // Auto-discover subdirectory
                    },
                ],
            },
            {
                id: "advanced",
                label: "Advanced",
                groups: [
                    // <- Another single-level nesting
                    { id: "performance", label: "Performance", autoGenerated: true },
                    { id: "security", label: "Security", autoGenerated: true },
                ],
            },
        ],
    },
};

Structure:

  • Root: 2 groups (core, advanced)
  • core has 2 subgroups (entries, groups)
  • advanced has 2 subgroups (performance, security)
  • Maximum depth: 2 levels

File Organization Matching

Your folder structure should mirror the navigation:

content/docs/
β”œβ”€β”€ core-concepts/          <- Matches "core" group
β”‚   β”œβ”€β”€ entries/            <- Matches "entries" subgroup
β”‚   β”‚   β”œβ”€β”€ what-are-entries.mdx
β”‚   β”‚   └── folder-vs-manual.mdx
β”‚   └── groups/             <- Matches "groups" subgroup
β”‚       β”œβ”€β”€ basic.mdx
β”‚       β”œβ”€β”€ nested.mdx
β”‚       └── advanced.mdx
└── advanced/               <- Matches "advanced" group
    β”œβ”€β”€ performance/        <- Matches "performance" subgroup
    β”‚   β”œβ”€β”€ optimization.mdx
    β”‚   └── benchmarking.mdx
    └── security/           <- Matches "security" subgroup
        β”œβ”€β”€ best-practices.mdx
        └── vulnerabilities.mdx

Users see clear navigation path:

Home > Docs > Core Concepts > Entries > What are Entries
Home > Docs > Advanced > Performance > Optimization
Home > Docs > Advanced > Security > Best Practices

Clear hierarchy. Not too deep.

Auto-Generation with Single Nesting

{
    id: "guides",
    label: "How-To Guides",
    groups: [
        {
            id: "getting-started",
            label: "Getting Started",
            autoGenerated: true,  // Auto-discover all files in guides/getting-started/
        },
        {
            id: "advanced-tasks",
            label: "Advanced Tasks",
            autoGenerated: true,  // Auto-discover all files in guides/advanced-tasks/
        },
    ],
}

Files added to content/docs/guides/getting-started/ appear automatically under β€œGetting Started” subgroup.

Files added to content/docs/guides/advanced-tasks/ appear automatically under β€œAdvanced Tasks” subgroup.

No config changes needed.

Mixed Auto and Manual

{
    id: "platform",
    label: "Platform",
    groups: [
        {
            id: "essentials",
            label: "Essentials",
            autoGenerated: true,  // Auto-discover
        },
        {
            id: "integration",
            label: "Integration",
            autoGenerated: false,  // Manual entries
            entries: [
                { slug: "platform/webhooks" },
                { slug: "platform/oauth" },
                { slug: "platform/rest-api" },
            ],
        },
    ],
}

essentials subgroup: Files appear automatically integration subgroup: Only listed entries appear

When to Use Single-Level Nesting

Perfect for:

  • Documentation with 2-3 organizational layers
  • Most projects and products
  • Clear category -> subcategory -> page structure
  • Team documentation
  • Feature documentation

Examples:

Getting Started
β”œβ”€β”€ Installation
β”œβ”€β”€ Configuration
└── First Steps

Features
β”œβ”€β”€ Authentication
β”œβ”€β”€ Database
└── API

Advanced
β”œβ”€β”€ Performance
β”œβ”€β”€ Security
└── Troubleshooting

Visual Navigation

Users see a navigation sidebar like:

Getting Started (Expanded)
  β”œβ”€ Installation
  β”œβ”€ Configuration
  └─ First Steps

Features (Expanded)
  β”œβ”€ Authentication
  β”œβ”€ Database
  └─ API

Advanced (Collapsed)
  └─ [+] Expand...

When they click β€œAdvanced”, it expands to show Performance, Security, Troubleshooting.

When they’re viewing a page in β€œPerformance”, sidebar shows:

Advanced (Expanded)
  β”œβ”€ Performance (Current section)
  β”œβ”€ Security
  └─ Troubleshooting

Performance

Single-level nesting is efficient:

  • Quick to navigate
  • Small navigation tree size
  • Fast rendering
  • Clear mental model

Compared to deeper nesting, users never get lost.

Comparison

Too shallow (no nesting):
β”œβ”€ Getting Started
β”œβ”€ Features
β”œβ”€ Advanced
β”œβ”€ API Reference
β”œβ”€ Examples
β”œβ”€ Troubleshooting
[Long list, hard to scan]

Single-level (perfect):
β”œβ”€ Getting Started
β”‚  β”œβ”€ Installation
β”‚  β”œβ”€ Configuration
β”‚  └─ First Steps
β”œβ”€ Features
β”‚  β”œβ”€ Authentication
β”‚  β”œβ”€ Database
β”‚  └─ API
└─ Advanced
   β”œβ”€ Performance
   β”œβ”€ Security
   └─ Troubleshooting
[Organized, scannable, not too deep]

Too deep (multiple levels):
β”œβ”€ Docs
   β”œβ”€ Getting Started
   β”‚  β”œβ”€ Installation
   β”‚  β”‚  β”œβ”€ Prerequisites
   β”‚  β”‚  β”œβ”€ Windows
   β”‚  β”‚  └─ macOS
   β”‚  β”œβ”€ Configuration
   β”‚  β”‚  β”œβ”€ Basic
   β”‚  β”‚  β”œβ”€ Advanced
   β”‚  β”‚  └─ Custom
   └─ Features
[Hard to navigate, too much clicking]

Single-level is the sweet spot for most documentation.

Next Steps