The menu component supports nested navigation items and automatically highlights the active page based on the current URL.
The DocsSidebarNav component accepts an array of SidebarNavItem objects and an optional className prop. Each item can have nested children, labels, disabled state, and external links.
The simplest usage with just titles and hrefs:
Add visual badges using the label property. Supported values are "new", "recent", and "updated":
Create multi-level navigation by nesting items within the items array:
A comprehensive example showcasing all properties together:
| Prop | Type | Default | Notes |
|---|---|---|---|
items | SidebarNavItem[] | — | Structured tree containing sections and child links. Matches `docsConfig.sidebarNav`. |
item.href | string | — | Optional URL used to highlight the active link through `usePathname`. |
item.label | "new" | "recent" | "updated" | — | Renders color-coded badges next to the nav item. |
item.items | SidebarNavItem[] | [] | Nest additional pages to create multi-depth menus. |
item.disabled | boolean | false | Disables the nav item, making it non-clickable and visually muted. |
item.external | boolean | false | Opens the link in a new tab with proper security attributes. |
className | string | — | Optional CSS class to apply custom styling to section titles. |
<a> tags for screen-reader support.