Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Drill-Down Drawer Navbar Block for React

A drawer navbar for a travel planner: a Menu button at every width opens a sheet from the end where Plan and Explore slide a second panel in with a Back button, with Pricing and Help centre as plain links and a Shine Button at the foot.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A drill-down drawer navbar for React with Base UI, the menu for sites whose navigation has two levels. One bar sits between the page's rails with the wordmark, a ghost Sign in and a Menu button that shows at every width, with no inline links, so the drawer is what you see in a gallery. The button opens a sheet from the end of the page: Plan and Explore are rows that slide a second panel in over the first, each with a Back button and the group's links (an icon, a name and a line each), while Pricing and Help centre are plain links and a Shine Button and three small links close the sheet's foot. The panels are two pages of one grid cell moving with CSS transforms, the one not showing is inert, and focus follows: to Back on the way in, back to the row you left on the way out. The sheet opens over the page, so the block stays one bar high (56 pixels), and its bottom edge is the next block's top rule. It's built from Sheet, Button, Shine Button and Guides, with your theme's tokens for every colour. For travel, commerce, documentation and any site whose menu is too big for one list on a phone.

FAQ

How do I change the groups and links?

Edit GROUPS at the top of the file: each group has an id, a label, a summary shown under its row and a list of items (a title, a one-line description, an icon and an href). PAGES holds the plain links under the rows and FOOT the three small links at the foot. Add a third group and it gets its own row and its own panel; keep a group to about four to six items so its panel fits a phone.

How does the drill-down work?

The root list and each group's panel share one grid cell. Choosing a group row moves the root panel out and the group's panel in with a 300 ms CSS transform, and Back reverses it. The panel that isn't showing is inert, so a keyboard and a screen reader never reach it, and the row says whether its panel is open and which one it controls. The sheet's state is held in the block: closing the sheet by any route puts it back on the root list.

Where does focus go?

Opening a group moves focus to its Back button; Back moves it to the row you came from; Escape in a group closes the whole sheet and focus goes back to the Menu button, as it does for the close button and for choosing a link. Focus stays inside the sheet while it's open. The sheet is a modal dialog named Menu, opened by the Menu button rendered through render.

Can it show inline links on a desktop?

Yes. Add md:hidden to the Menu button and a nav of links with max-md:hidden next to the wordmark; the sheet stays for phones. This block keeps the button at every width so the drill-down is visible.

What happens in right-to-left layouts?

A sheet from the end of the page opens on the left in a right-to-left layout, so the sheet's edge and border switch sides, and the panels slide in from the other direction with their chevrons and Back arrows mirrored. The sheet's own slide-in is the catalog's and still starts from the right edge, a short offset only.

What moves, and what about reduced motion?

The sheet slides in from the end, the panels slide between each other, and a band of light sweeps across the Shine Button on hover and focus. With reduced motion the sheet appears without sliding, the panels swap at once and the light fades in where it stands.

  • Pro

    Fullscreen Overlay Navbar

    Mobile and drawers

    A full-screen menu navbar for an architecture studio: a two-line menu button at every width opens a sheet that fills the screen with five large numbered links on hairline rows that fade up one after the other.

  • Pro

    Animated Hamburger Navbar

    Mobile and drawers

    A menu-first navbar for a ceramics studio: a wordmark, a Shine Button and a hamburger whose three lines turn into a cross, opening a full-width card of six links that ease in one after the other.

  • Pro

    Bottom Tab Bar Navbar

    Mobile and drawers

    A bottom tab bar for a running-diary app: five cells on shared hairlines, four links with a filled current tab and an unread dot, and a raised Shine Button that opens a drawer from the bottom with three ways to create.

  • Pro

    A one-bar marketing navbar for a product roadmap tool: a wordmark, a Product menu of four areas with icons and one-line descriptions, plain links with the current page marked, Sign in and a Shine Button, and a sheet with the same links on phones.

  • Pro

    A one-bar navbar for an observability platform whose Products, Resources and Company menus each open a wide panel of three link columns closed by a footer strip, with an accordion of the same links in a sheet on phones.

  • Pro

    Sidebar Toggle Navbar

    Mobile and drawers

    A navbar with a sidebar toggle for a project tracker: a button, the [ key and a tooltip fold a mini sidebar under the bar between icons only and icons with labels, and on phones the same button opens it as a sheet.