Last updated

Sidebars configuration options

If you want to specify the order and link text for the items in your side navigation, create a sidebars.yaml file.

Requirements

Version > 0.1.0

OptionTypeDescription
pagestringCONDITIONALLY REQUIRED.*
Path to the file (extension included) that represents the page to link to.
If no label is provided, the link text will match the page's level 1 heading.
hrefstringCONDITIONALLY REQUIRED.*
URL to link to. Works with absolute and relative URLs.
If no label is provided, the link text will match the value used for href.
labelstringLink text displayed for the item.
labelTranslationKeystringSets the translation key for an item's link text. Used for localization.
externalbooleanConfigures item to open in new tab and adds an external link symbol next to sidebar entry. Defaults to false.
disconnectbooleanUsed with page option to include links to items in the sidebar without assigning the sidebar to that page. Defaults to false.
iconstringPath to icon image file. Shown on left side of sidebar entry.
rbacobjectPage-level access controls for sidebar links. See Configure RBAC in sidebar for more information.

* Sidebar links must use either the page or href option ("mutually exclusive").

Group options

OptionTypeDescription
groupstringREQUIRED.
Name of the group.
pagestringPath to the file (and extension) that represents a page. Loads when the group is clicked.
directorystringPath to a folder. Files in the folder are automatically added to the sidebar.
groupTranslationKeystringSets the translation key for a group. Used for localization.
menuStylestringValues:
drilldown -- when user selects a group, the sidebar shows only that group's items and hides the other sidebar elements.
expandedstringValues:
true -- Items are expanded when page loads. Users can click to collapse the group.
false -- Default. Items are collapsed when page loads. Users can click to expand.
always -- Items are expanded when page loads and can't be collapsed.
selectFirstItemOnExpandbooleanAutomatically open first item in group when group is clicked and expanded. Defaults to false.
iconstringPath to icon image file. Shown on left side of group.
itemsobject
(Link)
REQUIRED.
A list of items, where each item is configured using link options.

Additional options

OptionTypeDescription
separatorstringStatic text used to separate items on the sidebar.
separatorLinebooleanHorizontal bar used to break sidebar into sections. Can be used in sidebar root or inside a group.
$refstringPath to another sidebar file. Entries from other sidebar are expanded into the sidebar created by this sidebars.yaml file. See split sidebars documentation for more detail.

Example

The following is an example sidebars.yaml file:

sidebars.yaml
- page: overview.md
- page: installation.md
  label: Installation
- group: Config
  selectFirstItemOnExpand: true
  items:
    - page: config/index.md
    - page: config/developer-onboarding.md
      label: Developer Onboarding
    - group: Reference
      page: config/reference/index.md
      items:
        page: config/reference/config-files.md
        label: Config Files
- group: Content
  menuStyle: drilldown
  icon: ./images/custom-icon.png
  items:
    - directory: content
- $ref: ./templates/sidebars.yaml
- group: Plugins
  items:
    - directory: plugins
- group: Resources
  items:
    - href: https://redocly.com/docs
      label: Great docs
    - href: /docs/cli/v1.3
      label: Legacy CLI docs