Sidebars
A sidebar appears on the leading side of a view and lets people navigate between sections in your app.
When to use it
Use a sidebar for top-level navigation with up to two levels of nesting. For data, use a list.
Preview
Anatomy
By default the sidebar is a full-bleed strip on the window’s leading edge, with no radius, shadow, inset or divider. In a window, it also holds the traffic lights (see windows).
| Part | Value |
|---|---|
| Width | 240px, full window height |
| Material | Flat, neutral #E6E6E6 |
| Row inset | 10px, so a selection capsule is 220px wide |
The macOS 26 floating panel is still available as .p-sidebar-floating.
| Part | Value |
|---|---|
| Radius | 18px |
| Material | Gray glass at rgba(228, 228, 228, 0.72) over a 20px blur |
| Shadow | 0 8px 40px at 12% |
.p-sidebar-attached still works: it fills the host’s height.
| Class | Role |
|---|---|
.p-sidebar | The strip. 240px, flat #E6E6E6, 10px padding. |
.p-sidebar-floating | Floating glass panel, radius 18px, soft shadow. |
.p-sidebar-attached | Fills the host’s height. |
.p-sidebar-titlebar | 52px header zone: lights at 19,19, first row 52px down. |
.p-sidebar-toggle | Places a 36px round glass button (.p-toolbar-circle) 8px from the top and trailing edges. |
.p-sidebar-row | One row. 36px tall, radius 8px, 15px text at weight 510. |
.p-sidebar-icon | 20px icon slot. Label starts 36px into the row. |
.p-sidebar-detail | Right-aligned secondary text in #BFBFBF. |
.p-sidebar-header | Section heading, 13px bold in #727272, 8px in from the row edge. |
.p-sidebar-chevron | Disclosure chevron, 11px bold in #BFBFBF. |
data-p-level="1..4" | Indentation, 12px per level. |
Sizes
Three sizes step the row height, font, and icon together. The label starts 32px into the row in small and medium, and 36px in large. Image icons take a 4px radius. Indentation stays at 12px per level in every size.
| Size | Class | Row | Font | Icon |
|---|---|---|---|---|
| Large (default) | 36px | 15px / 510 | 20px | |
| Medium | .p-sidebar-medium | 32px | 13px / 510 | 18px |
| Small | .p-sidebar-small | 24px | 11px / 510 | 16px |
| Part | Large and medium | Small |
|---|---|---|
| Section header | 13px bold | 11px bold |
| Gap between rows | 43px | 39px |
States
Every row icon carries the accent tint, #0078F0. Selection stays quiet: the capsule darkens the material by 13 levels (rgba(0, 0, 0, 0.056), which gives #D9D9D9 on the strip), and the label does not change. Hover darkens it by 4 levels.
| State | Class | Values |
|---|---|---|
| Rest | Label #1A1A1A, icon #0078F0 | |
| Hover | Fill rgba(0, 0, 0, 0.018) | |
| Selected | .p-selected | Fill rgba(0, 0, 0, 0.056) (#D9D9D9 on the strip) |
| Dimmed | .p-dimmed or aria-disabled="true" | Label #BFBFBF; the icon keeps its tint |
| Inactive window | .p-window-inactive on the window, or .p-inactive | Material lightens to #F1F1F1, icons turn #878787 |
To retint the icons, override the token on the sidebar: style="--p-sidebar-icon: #FF2D55".
Dark mode
| Part | Dark |
|---|---|
| Strip | #161616 |
| Selection | Lightens the strip by 13 levels (#232323) |
| Hover | Lightens the strip by 7 levels |
| Icons | #0A99FF |
| Labels | #F5F5F5 |
| Headers | #8A8A8A |
| Inactive window strip | #141414 |
| Inactive window icons | #666666 |
Both .p-dark-mode and .p-auto-dark-mode are supported.
Code
<nav class="p-sidebar" aria-label="Mailboxes">
<div class="p-sidebar-row p-selected" tabindex="0" aria-current="page">
<span class="p-sidebar-icon"><img src="inbox.png" alt="" /></span>
Inbox
<span class="p-sidebar-detail">12</span>
</div>
<div class="p-sidebar-header">Smart Folders <span class="p-sidebar-detail">›</span></div>
<div class="p-sidebar-row" data-p-level="1" tabindex="0">Receipts</div>
</nav>
Use <nav> with a label, aria-current="page" on the active row, and tabindex="0" so rows are keyboard reachable. The default strip is already opaque. For the floating panel, prefers-reduced-transparency turns the glass opaque #ECECEC (dark: #2B2B2E) and removes the blur, and browsers without backdrop-filter get the same fallback. With prefers-contrast: more the selected row gains a 1px ring.