Skip to content
Storybook

Sidebar

Primary app navigation. Expanded 280px with search and account; collapsed 80px icon rail.

Preview

React · live from the Storybook

HTML and CSS

The same component as plain HTML with pixels-ui.css, no framework needed.

Usage

  • Collapsed items show the icon only; pair with a Tooltip.

Installation

Included in the core files. No extra install.

HTML
<link rel="stylesheet" href="/css/pixels-tokens.css">
<link rel="stylesheet" href="/css/pixels-ui.css">
<script src="/js/pixels-ui.js" defer></script>

API reference

Class / attributeTypeDescription
px-sidebar · --collapsedclassExpanded / collapsed.
px-nav-itemclassLink; aria-current="page" when selected.
data-px-sidebar-toggleattributeCollapse button.

Figma properties

Sidebar4 variants · page “Application navigation”Open

Primary app navigation. Expanded 280px with search and account; Collapsed 80px icon rail. Sits on the inline-start edge: left in LTR, right in RTL. Use <nav aria-label="Main">.

PropertyTypeValues
CollapsedVariantFalse True
DirectionVariantLTR RTL
Nav item16 variants · page “Application navigation”Open

Sidebar navigation link with icon, label and optional count. Selected marks the current section (aria-current="page"). Collapsed shows the icon only; pair it with a Tooltip.

PropertyTypeValues
LabelText“Home”
IconInstance swap—
CountBoolean—
CollapsedVariantFalse True
StateVariantDefault Hover Focused Selected
DirectionVariantLTR RTL

Design tokens

Component tokens from the Figma Component collection. Override them to restyle just this component.

TokenAliasLight value
--px-nav-bordercolor-border-neutral-subtle#f2f4f7
--px-nav-item-iconcolor-content-neutral-tertiary#667085
--px-nav-item-radiusradius-1212px
--px-nav-item-heightspacing-4040px
--px-sidebar-widthsize-264264px
--px-sidebar-paddingspacing-1212px
--px-sidebar-gapspacing-1212px
--px-sidebar-radiusradius-2020px
--px-nav-item-padding-xspacing-1212px
--px-nav-item-gapspacing-1212px

Accessibility

  • Use <nav aria-label="Main">.