Sidebar
Labels are controlled by frontmatter properties on a given page, which vary depending on if you are configuring a group or a link.
In order of precedence:
sidebar.label
title
Index page labels default to Overview
if sidebar.label
is not defined.
title
is not taken into consideration due to title
being used in group labelling.
In order of precedence:
sidebar.group.label
title
For example, given the following pages:
The sidebar structure will look like:
DirectoryGroupTitle
- IndexTitle
- PageTitle
If we remove the sidebar
property from both, it will now look like this:
DirectoryBar
- Overview
- Baz
Both links and groups use the sidebar.order
frontmatter property to configure their ordering, where groups are ordered based on the index page's order.
If sidebar.order
is not specified, it will fallback to alphabetical ordering.
For example, given the following pages:
The sidebar structure will look like:
DirectoryBeta
- ...
DirectoryAlpha
- ...
If we remove the sidebar
property from both, it will now look like this:
DirectoryAlpha
- ...
DirectoryBeta
- ...
There are three properties that can be used for hiding pages from the sidebar.
This property should only be used when the page is not an index page for a group.
Since index pages are relied on to configure the label and sort order of groups, we have a special property that still makes the page available to our sidebar component and allows us to remove it after labelling and ordering groups.
To make a group render as if it was a single page, which links to the index page, use the top-level hideChildren
property.
To specify a badge next to the link, use the sidebar.badge
property.
DirectoryExamples
- Example [New!]
To specify a badge next to the group label, use the sidebar.group.badge
inside the group's index.mdx
frontmatter.
DirectoryExamples [New!]
- Example