Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Master-Detail Dropdown Navbar Block for React

A one-bar navbar for a developer cloud whose Platform and Solutions menus open a master-detail panel built as vertical tabs, a list of areas that drives the pane beside it by hover, focus or arrow keys, with a drill-down sheet on phones.

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 master-detail navbar for React with Base UI. The wordmark leads; Platform and Solutions each open a panel that is a set of vertical tabs: at the start a list of areas (API, SDK, CLI and Dashboard; three audiences for Solutions), and beside it, past a hairline, the selected area's pane with a heading, one line and three links with descriptions. Hover an area, focus it or press the arrow keys and the pane follows; the panel keeps one size across areas, so nothing jumps. Pricing and Docs (the current page, marked by a foreground stroke on the bar's bottom edge) follow as plain links, and Sign in and a Start building Shine Button close the row. Below the md breakpoint a menu button opens a sheet from the top that drills down: the areas of both menus first, each with a chevron, and tapping one swaps the sheet to that area's heading and links under a Back button. The panels and the sheet open over the page, so the block stays one bar high (64 pixels, 56 on a phone), and the bar draws no bottom border. It's built from Navigation Menu, Tabs, Sheet, Guides, Shine Button and Button, with your theme's tokens for every colour. For developer sites whose menu is really a table of contents.

FAQ

How do the tabs behave?

The list is a vertical tab list with automatic activation: moving to an area selects it, whether by pointer, by focus or by the Up and Down arrow keys, and Home and End jump to the first and last. Tab leaves the list and lands on the pane, whose links are ordinary links. Each pane is a tab panel labelled by its area. Each menu remembers its own selection while the page lives, so Solutions keeps the audience you last looked at.

How does it work with a keyboard and a screen reader?

The links sit in a nav landmark named Main, after the wordmark (a link home). Tab reaches the wordmark, Platform, Solutions, Pricing, Docs, Sign in and Start building. Enter or Space opens a menu, its button says whether it is expanded, and Escape closes it and puts focus back on its button. Focus stays on the menu's button when it opens; Tab moves into the list of areas and again into the pane. The arrow keys move between areas, and along the bar from a trigger. The menus also open on hover, and moving between them resizes one panel.

How does the drill-down work on a phone?

Below the md breakpoint the wordmark, Start building and a menu button stay on the bar, and nothing wraps at 320 pixels. The menu button opens a sheet from the top whose header lines up with the bar. Its first view lists every area under its menu's name (Platform, Solutions) with a chevron, then Pricing and Docs. Tapping an area swaps the view in place, in the same box so the sheet doesn't change height, to a Back button named after the menu, the area's heading and line, and its three links; focus moves to Back, and Back returns to the list with focus on the row you came from. The view you left is inert, so the keyboard and screen readers only meet one at a time. Closing the sheet resets it to the list. Sign in and Start building stay at the foot of both views; Escape, the close button or choosing a link closes the sheet and focus goes back to the menu button.

Does choosing a link close the menu?

Yes, in the panels and in the sheet, so a client-side route change that keeps the navbar mounted doesn't leave a menu open over the new page. Each pane link takes closeOnClick. The sheet's open state is held in the block too (sheetOpen), and each of its links closes it. Every link points at #: point them at your pages. Sign in and Start building render the link they're given with render, with nativeButton={false}.

How does it sit on the page, and can it stick to the top?

The navbar is the page's first block: its + marks and rails line up with every block under it, its top rule falls on the window's top edge, and it draws no bottom border, because the next block's top rule is its bottom edge. To keep the bar in view while the page scrolls, add sticky top-0 z-40 bg-background/80 backdrop-blur to the header; the menus still open under it. With reduced motion the panels and the sheet appear without their fades and slides, and the drill-down swaps without fading.

  • 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

    A one-bar navbar for a serverless hosting platform whose Platform menu opens a list of five products beside a framed preview that follows the row you hover or focus, with a flat list in a sheet from the start edge on phones.

  • Pro

    A one-bar navbar for a workflow-automation tool whose three triggers each open a narrow flyout under themselves, a plain list, a described list with status badges and a promo card with a small chart, with a caret pointing at the open trigger and collapsible rows in a sheet on phones.

  • 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 a workforce-management platform with Platform and Solutions menus, a hairline that splits the bar, and at its end a SOC 2 badge that opens a popover of certifications, then Try demo and a sales button.

  • Pro

    A one-bar navbar for a design-system suite whose Products menu opens a 3 by 2 grid of cells and whose Solutions menu opens a 2 by 3 grid of industries, cells sharing hairlines, with accordion groups in a sheet on phones.