Introduction
nv-sidebar provides a vertical navigation sidebar for application layouts.
It supports persistent and collapsible modes, nested navigation groups with
sub-items, notification badges, and automatic active-state highlighting based
on the current route.
Key features:
- Persistent and collapsible sidebar modes
- Nested navigation with sub-items
- Notification badges with configurable intention and emphasis
- Automatic active state management via
active-path
Choosing a mode
| Mode | Behavior |
|---|---|
persistent | Always expanded; suited to wide application shells. |
collapsible | Collapses to an icon rail; toggled by the user. |
<nv-sidebar type="collapsible" open>
<nv-sidebarlogo label="My App"></nv-sidebarlogo>
<nv-sidebarcontent>
<nv-sidebargroup label="Main">
<nv-sidebarnavitem icon="home">
<a href="/dashboard">Dashboard</a>
</nv-sidebarnavitem>
</nv-sidebargroup>
</nv-sidebarcontent>
</nv-sidebar>
Nested navigation
Collapsible nav items host nv-sidebarnavsubitem children. A nav item with
notification-count renders a badge; its look follows the sidebar's
notification-intention and notification-emphasis.
Active state
Set active-path on the sidebar to the current route. Items whose link
matches (or whose sub-item matches) highlight automatically — no per-item
bookkeeping needed.
<nv-sidebar type="persistent" active-path="/analytics/reports">
...
</nv-sidebar>