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, with no radius, shadow, inset or divider. In a window, it also holds the traffic lights (see windows).

PartValue
Width240px, full window height
MaterialFlat, neutral #E6E6E6
Row inset10px, so a selection capsule is 220px wide

The macOS 26 floating panel is still available as .p-sidebar-floating.

PartValue
Radius18px
MaterialGray glass at rgba(228, 228, 228, 0.72) over a 20px blur
Shadow0 8px 40px 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
PartLarge and mediumSmall
Section header13px bold11px bold
Gap between rows43px39px

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

PartDark
Strip#161616
SelectionLightens the strip by 13 levels (#232323)
HoverLightens 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.

Copied