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
Breadcrumb Result
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.