Sidebar Nav
Compact text navigation for docs and settings sidebars.
Installation
pnpm dlx shadcn@latest add @paneui/sidebar-navUsage
Composition
Examples
When to use
For long page trees in docs, settings and admin sidebars. For an app rail with icons that folds to a strip, use Animated Sidebar.
Icon alignment
Rows align automatically when their section uses icons.
Keyboard
Section buttons expose their expanded state. The current page scrolls into view on mount.
SidebarNav
Column that fills its container. Also accepts every prop of div.
- variant= "default"
- "default" | "fill"
- Use fill for an opaque shell surface.
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "default" | "fill" | "default" | Use fill for an opaque shell surface. |
SidebarNavSearch
A field-shaped button that opens your search. Also accepts every prop of button.
- shortcut
- React.ReactNode
- Key cap at the end, such as
⌘K. - children= `labels.searchPlaceholder`
- React.ReactNode
- The field text. The default comes from the locale.
| Prop | Type | Default | Description |
|---|---|---|---|
| shortcut | React.ReactNode | — | Key cap at the end, such as ⌘K. |
| children | React.ReactNode | `labels.searchPlaceholder` | The field text. The default comes from the locale. |
SidebarNavSection
Also accepts every prop of Collapsible.Root.
- label*
- React.ReactNode
- Heading text.
- count
- number
- Muted count after the label.
- level= "section"
- "section" | "group"
groupis a smaller muted heading inside a section.- collapsible= true
- boolean
falsedrops the toggle and keeps it open.- href
- string
- Makes the label a link to the section's own page; the chevron beside it still folds the rows.
- labelRender
- React.ReactElement | (props) => React.ReactElement
- Renders the label link with your router's link, such as
<Link href="…" />. - active= false
- boolean
- Marks the label's page as current with the fill, the bar and
aria-current="page". - icon
- React.ReactNode
- Leading icon in the same 16px slot as
SidebarNavLink, muted until the label is hovered or current. - toggleLabel
- string
- Name of the chevron button beside a linked label. Defaults to the locale's
toggleNamed(label).
| Prop | Type | Default | Description |
|---|---|---|---|
| label* | React.ReactNode | — | Heading text. |
| count | number | — | Muted count after the label. |
| level | "section" | "group" | "section" | group is a smaller muted heading inside a section. |
| collapsible | boolean | true | false drops the toggle and keeps it open. |
| href | string | — | Makes the label a link to the section's own page; the chevron beside it still folds the rows. |
| labelRender | React.ReactElement | (props) => React.ReactElement | — | Renders the label link with your router's link, such as <Link href="…" />. |
| active | boolean | false | Marks the label's page as current with the fill, the bar and aria-current="page". |
| icon | React.ReactNode | — | Leading icon in the same 16px slot as SidebarNavLink, muted until the label is hovered or current. |
| toggleLabel | string | — | Name of the chevron button beside a linked label. Defaults to the locale's toggleNamed(label). |
SidebarNavLink
A row inside its own li. Use render for your router's link. Also accepts every prop of a.
- active= false
- boolean
- Marks the current page with a fill, a bar in the gutter and
aria-current="page". - icon
- React.ReactNode
- Leading icon in a 16px slot, muted until the row is hovered or current.
- badge
- React.ReactNode
- Trailing content, such as a New badge.
| Prop | Type | Default | Description |
|---|---|---|---|
| active | boolean | false | Marks the current page with a fill, a bar in the gutter and aria-current="page". |
| icon | React.ReactNode | — | Leading icon in a 16px slot, muted until the row is hovered or current. |
| badge | React.ReactNode | — | Trailing content, such as a New badge. |