Desktop components

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. It is 240px wide and runs the full height of the window, with no radius, shadow, inset or divider; the window clips it at its corner. The material is a flat, neutral #E6E6E6. Rows are inset 10px, so a selection capsule is 220px wide. In a window, the sidebar also holds the traffic lights (see windows).

The macOS 26 floating panel is still available as .p-sidebar-floating: radius 18px, gray glass at rgba(228, 228, 228, 0.72) over a 20px blur, and a 0 8px 40px shadow at 12%. .p-sidebar-attached still works: it fills the host’s height.

ClassRole
.p-sidebarThe strip. 240px, flat #E6E6E6, 10px padding.
.p-sidebar-floatingFloating glass panel, radius 18px, soft shadow.
.p-sidebar-attachedFills the host’s height.
.p-sidebar-titlebar52px header zone: lights at 19,19, first row 52px down.
.p-sidebar-togglePlaces a 36px round glass button (.p-toolbar-circle) 8px from the top and trailing edges.
.p-sidebar-rowOne row. 36px tall, radius 8px, 15px text at weight 510.
.p-sidebar-icon20px icon slot. Label starts 36px into the row.
.p-sidebar-detailRight-aligned secondary text in #BFBFBF.
.p-sidebar-headerSection heading, 13px bold in #727272, 8px in from the row edge.
.p-sidebar-chevronDisclosure 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.

SizeClassRowFontIcon
Large (default)36px15px / 51020px
Medium.p-sidebar-medium32px13px / 51018px
Small.p-sidebar-small24px11px / 51016px

Section headers are 13px bold in large and medium and 11px bold in small. They sit in a 43px gap between rows (39px in small).

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.

StateClassValues
RestLabel #1A1A1A, icon #0078F0
HoverFill rgba(0, 0, 0, 0.018)
Selected.p-selectedFill 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-inactiveMaterial lightens to #F1F1F1, icons turn #878787

To retint the icons, override the token on the sidebar: style="--p-sidebar-icon: #FF2D55".

Dark mode

The strip becomes #161616. Selection lightens it by 13 levels (#232323) and hover by 7. Icons turn #0A99FF, labels #F5F5F5 and headers #8A8A8A. In an inactive window the strip goes to #141414 and the icons to #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.

Copied