Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Drawer examples · Left

Left Drawer Navigation Menu for React

A left drawer with a navigation menu of icon buttons: Home, Team, Projects, Settings and Help.

Framework
UI library

A navigation menu in a left drawer: five ghost buttons with an icon and a label each, in a nav. The menu button that opens it is icon-only, so it carries an aria-label. Swap the buttons for links to your pages.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

Which items does the menu have?

Home, Team, Projects, Settings and Help, each a ghost Button with justify-start, an icon marked data-icon="inline-start" and its label.

Where is the drawer's title?

Navigation, above the menu, is the DrawerTitle. DrawerTitle names the dialog for assistive tech, so every drawer renders one; give it sr-only when the design has no visible heading.

How does the drawer open from the left?

swipeDirection="left" on Drawer puts it on the left edge. The prop names the swipe that closes the drawer, so left docks it on the left; leave it out for a bottom drawer.

How is the menu button labeled?

An outline icon button opens the drawer. Its aria-label, Open navigation, is the accessible name; the icon is aria-hidden. The Button goes in the render prop of DrawerTrigger.

Does the drawer close when an item is picked?

Not in this demo: the items have no handler. Close it when people navigate: Pass open to Drawer; onOpenChange receives the next boolean.