Skip to main content
NavigationLevel 2

Sidebar

侧边栏

WebDesktopMobileDifficulty: Medium

A navigation panel pinned to one edge of the screen — always visible, or sliding out from a hamburger button.

01

Live Demo

Actually clickable
Icon-only (80px)

Main content

Hit "Toggle" to see the difference between a nav rail and a sidebar: icon-only vs expanded — really the same thing at two widths.

What you just saw:The page tree down the left of Notion, the repository menu on the left of GitHub, the list of mail folders that slides in from the left when you open Gmail — all sidebars.

02

What it actually is

A sidebar is a container shape for navigation: persistent on the left on desktop, a slide-over panel on mobile. How it differs from a navigation rail is that a sidebar usually carries text labels and group headings — it is navigation in its expanded form.

drawer navside panelside menuslide-over navoff-canvas menu
03

Anatomy · What it's made of

  1. Panel面板

    Fixed to the side, can slide open

  2. Header顶部区

    Logo / title / close button

  3. Nav Group导航分组

    A set of destinations under a small heading

  4. Item导航项

    Icon + text, can nest children

  5. Scrim遮罩

    The translucent overlay covering content on mobile

04

When to Use

When it fits, and when it doesn't
Sidebar usage recommendations
SituationUse it?
Many destinations that need grouping and text labelsYes
On desktop, navigation should stay visibleYes
Mobile needs to hold destinations that do not fit in bottom navigationYes
The page itself is very short, with only 2–3 destinationsNo

Spending 240px of width on three or four destinations is obvious wasted space.

A persistent sidebar on mobile squeezes the content area very narrow.

05

Similar Patterns

Don't mix these up
06

How to tell AI

Three levels of prompt

Add the component name and specifics

Add a sidebar that slides in from the left, with two groups — "Workspace" and "Personal" — opened by a hamburger button on mobile and persistent on desktop.

07

Don't just say this to AI

Bad → Better

Don't say this to AI

Add a menu on the left that slides out.

Say this instead

Add a slide-over sidebar (260px wide): persistent on desktop, opened by a hamburger button with a scrim on mobile, grouped under "Workspace / Personal", dismissible with Esc.

08

Share this card

Social-ready

Turn this pattern into a 3:4 or 1:1 knowledge card and export it as PNG right in the browser. No backend needed.