Multi-Level Nesting
Multi-level nesting means groups nested 3+ levels deep. Use this when your documentation has complex hierarchies.
Deep Nesting Structure
Level 0 (Root)
βββ Level 1 Group
βββ Level 2 Subgroup
βββ Level 3 Subsubgroup
βββ Entries (Pages)
Depth: 4 levels from root to pages. Can be even deeper.
Configuration Example
export const SIDEBAR_NAVIGATION = {
platform: {
defaultTab: { label: "Platform", icon: "π" },
groups: [
{
id: "platform-suite",
label: "Platform Suite",
groups: [
{
id: "core-services",
label: "Core Services",
groups: [
{
id: "authentication",
label: "Authentication",
groups: [
{
id: "oauth",
label: "OAuth 2.0",
autoGenerated: true,
},
{
id: "saml",
label: "SAML",
autoGenerated: true,
},
],
},
{
id: "data-storage",
label: "Data Storage",
groups: [
{
id: "databases",
label: "Databases",
autoGenerated: true,
},
{
id: "caching",
label: "Caching",
autoGenerated: true,
},
],
},
],
},
{
id: "integrations",
label: "Integrations",
groups: [
{
id: "third-party",
label: "Third-Party Services",
groups: [
{
id: "payments",
label: "Payment Processors",
autoGenerated: true,
},
{
id: "analytics",
label: "Analytics Providers",
autoGenerated: true,
},
],
},
],
},
],
},
],
},
};
Depth: 6 levels from root to pages.
File Organization for Deep Nesting
Folder structure mirrors navigation depth:
content/platform/
βββ platform-suite/ <- Level 1
βββ core-services/ <- Level 2
β βββ authentication/ <- Level 3
β β βββ oauth/ <- Level 4
β β β βββ getting-started.md
β β β βββ setup.md
β β β βββ troubleshooting.md
β β β βββ examples.md
β β βββ saml/ <- Level 4
β β βββ overview.md
β β βββ integration.md
β β βββ federation.md
β βββ data-storage/ <- Level 3
β βββ databases/ <- Level 4
β β βββ postgresql.md
β β βββ mongodb.md
β β βββ performance.md
β βββ caching/ <- Level 4
β βββ redis.md
β βββ memcached.md
β βββ strategies.md
βββ integrations/ <- Level 2
βββ third-party/ <- Level 3
βββ payments/ <- Level 4
β βββ stripe.md
β βββ paypal.md
β βββ webhook-handling.md
βββ analytics/ <- Level 4
βββ google-analytics.md
βββ mixpanel.md
βββ event-tracking.md
Resulting Breadcrumbs
Navigation paths get long but clear:
Home > Platform > Core Services > Authentication > OAuth > Getting Started
Home > Platform > Core Services > Data Storage > Databases > PostgreSQL
Home > Platform > Integrations > Third-Party > Payments > Stripe
Users understand exactly where they are.
When to Use Multi-Level Nesting
Good use cases:
- Enterprise software with many subsystems
- Complex APIs with multiple service tiers
- Large platforms with distinct areas
- Organizations with clear hierarchical structure
Examples:
π’ Enterprise Platform
ββ Account Management
β ββ User Management
β β ββ SAML
β β ββ OAuth
β β ββ LDAP
β ββ Organization
β β ββ Teams
β β ββ Permissions
β β ββ Roles
β ββ Billing
β ββ Subscriptions
β ββ Invoices
β ββ Payments
ββ Integrations
ββ Marketplace
β ββ Discovery
β ββ Installation
β ββ Publishing
ββ Webhooks
ββ Setup
ββ Events
ββ Best Practices
Navigation Sidebar Experience
Deep nesting creates collapsible sections:
βΌ Platform Suite
βΌ Core Services
βΌ Authentication (Current Section)
βΌ OAuth
β’ Getting Started (Current Page)
β’ Setup
β’ Troubleshooting
β’ Examples
β’ SAML
βΌ Data Storage
β’ Databases
β’ Caching
βΌ Integrations
βΌ Third-Party
β’ Payments
β’ Analytics
Users expand sections to explore. Collapses keep sidebar clean.
Auto-Generation at Each Level
{
id: "services",
label: "Services",
groups: [
{
id: "core",
label: "Core",
autoGenerated: false, // Manual control
groups: [
{
id: "auth",
label: "Authentication",
autoGenerated: true, // Auto-discover all files
groups: [
{
id: "methods",
label: "Methods",
autoGenerated: true, // Auto-discover all files in subdirs
},
],
},
],
},
],
}
Flexible mixing:
- Some levels auto-generated
- Some levels manual
- Choose per level what makes sense
Files in services/core/auth/methods/ appear automatically under Methods subgroup.
Performance Considerations
Deep nesting affects:
Navigation rendering: More levels = more DOM nodes = slight performance cost User experience: Too many clicks to reach content
Recommendations:
- Maximum 4-5 levels before getting cumbersome
- Beyond 5 levels, consider redesign
- Use tabs to split into 2-3 collections instead
Width Constraints
Deeply nested labels can wrap:
Home > Platform Suite > Core Services > Authentication > OAuth > Getting Started
Keep group labels short (2-3 words):
- β βOAuth 2.0β not βOAuth 2.0 Authentication Protocolβ
- β βUser Mgmtβ not βUser Management Systemβ
- β βPaymentsβ not βPayment Processing Integrationβ
Comparison: When to Use What
Simple (No nesting):
β 100+ pages in flat list
β
< 20 pages, simple structure
Single-Level (1 level deep):
β
30-100 pages with clear categories
β
Most documentation
β
2-3 organizational layers
Multi-Level (3+ levels deep):
β
200+ pages with complex structure
β
Enterprise software
β
Clear hierarchical system
β Might indicate need for multiple collections
Multiple Collections (separate sites):
β
Different audiences
β
Independent teams
β
Different navigation styles
β
Instead of extremely deep nesting
Migration Path
Starting simple and growing deep:
Step 1: Start flat
docs/
ββ intro.md
ββ setup.md
ββ guide.md
Step 2: Add single-level
docs/
ββ getting-started/
β ββ intro.md
β ββ setup.md
ββ guides/
ββ guide.md
Step 3: Add multi-level
docs/
ββ getting-started/
β ββ quick/
β β ββ intro.md
β β ββ setup.md
β ββ detailed/
β ββ prerequisites.md
β ββ configuration.md
ββ guides/
ββ basic/
β ββ guide.md
ββ advanced/
ββ guide.md
Configuration grows with folders. No migration neededβjust add nesting as content grows.