Docusaurus: Is there any way to create a nested dropdown sidebar

Created on 2 Mar 2020  Β·  3Comments  Β·  Source: facebook/docusaurus

πŸš€ Feature

(A clear and concise description of what the feature is.)

In the sidebar how can we create a nested dropdown menu items, Like the structure below

β”œβ”€β”€ coredns
β”‚Β Β  └── coredns-pod-delete
β”œβ”€β”€ Generic
β”‚Β Β  β”œβ”€β”€ container-kill
β”‚Β Β  β”œβ”€β”€ disk-fill
β”‚Β Β  β”œβ”€β”€ disk-loss
β”‚Β Β  └── pod-delete
β”œβ”€β”€ kafka
β”‚Β Β  β”œβ”€β”€ broker-disk-failure
β”‚Β Β  └── broker-pod-failure
└── openebs
    β”œβ”€β”€ pool-pod-failure
    β”œβ”€β”€ target-container-failure
    └── target-network-delay

Have you read the Contributing Guidelines on issues?

yes

Pitch

This requirement came from the here

feature

Most helpful comment

Hi, i think it is possible to do so in v2.

An example would be the docusaurus sidebar page.

Here is in sidebars.js

module.exports = {
  docs: {
    Docusaurus: ['introduction', 'design-principles', 'contributing'],
    'Getting Started': ['installation', 'configuration'],
    Guides: [
      'creating-pages',
      'styling-layout',
      'static-assets',
      {
        type: 'category',
        label: 'Docs',
        items: ['markdown-features', 'sidebar', 'versioning'],
      },
      'blog',
      'search',
      'deployment',
      'migrating-from-v1-to-v2',
    ],
    'Advanced Guides': ['using-plugins', 'using-themes', 'presets'],
    'API Reference': [
      'cli',
      'docusaurus-core',
      'docusaurus.config.js',
      'lifecycle-apis',
      'theme-classic',
    ],
  },
};

All 3 comments

Hi, i think it is possible to do so in v2.

An example would be the docusaurus sidebar page.

Here is in sidebars.js

module.exports = {
  docs: {
    Docusaurus: ['introduction', 'design-principles', 'contributing'],
    'Getting Started': ['installation', 'configuration'],
    Guides: [
      'creating-pages',
      'styling-layout',
      'static-assets',
      {
        type: 'category',
        label: 'Docs',
        items: ['markdown-features', 'sidebar', 'versioning'],
      },
      'blog',
      'search',
      'deployment',
      'migrating-from-v1-to-v2',
    ],
    'Advanced Guides': ['using-plugins', 'using-themes', 'presets'],
    'API Reference': [
      'cli',
      'docusaurus-core',
      'docusaurus.config.js',
      'lifecycle-apis',
      'theme-classic',
    ],
  },
};

It's already possible as per what @benclmnt said. Checkout website/sidebars.js for an example.

Thanks @benclmnt, I'll check this out

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ericnakagawa picture ericnakagawa  Β·  3Comments

cheercroaker picture cheercroaker  Β·  3Comments

azu picture azu  Β·  3Comments

rickyvetter picture rickyvetter  Β·  3Comments

itelofilho picture itelofilho  Β·  3Comments