Logo

Sidebar and Navigation

Understand how Docstra handles sidebar generation and page navigation.


Docstra provides an automated yet flexible navigation system that makes organizing your documentation effortless.

Auto-Generated Sidebar

By default, Docstra generates the sidebar based on the file structure of your content directory. This means your URLs and navigation hierarchy are always in sync.

Sorting and Naming

To control the order and display names of your sidebar items, you can use prefixes in your filenames:

Nested Navigation

Folders in your content directory translate into nested sections in the sidebar.

File Structure
content/ 01-index.mdx -> /docs 02-features/ 01-search.mdx -> /docs/features/search 02-components.mdx -> /docs/features/components

Customizing Sidebar

PropertyTypeDescription
titlestringMain title of the page (used for SEO + default sidebar label)
nav_titlestringOverrides title only in sidebar
iconstringLucide icon name (e.g., NotebookPen)
descriptionstringUsed for page description / SEO metadata
defaultOpenbooleanAutomatically expands this section in sidebar
collapsiblebooleanEnables/disables collapsing of a section
group_titlestringTitle for a folder/group in sidebar (only works on folders index file)

Example Usage (MDX Frontmatter)

mdx
--- title: My Page nav_title: Custom Sidebar Name icon: NotebookPen description: My Custom Description defaultOpen: true collapsible: false group_title: My Group Title ---

How It Works (Hierarchy Logic)


Pro Tips (Important)


Docstra automatically generates breadcrumb navigation at the top of each page, helping users understand their current location within the documentation hierarchy.

Table of Contents (TOC)

On the right side of each page, a Table of Contents is automatically generated based on the headings (h2 and h3) in your MDX content. It supports:

How is this guide?

Last updated on March 30, 2026