Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Featured Preview Mega Menu Navbar Block for React

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.

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 featured-preview navbar for React with Base UI. The wordmark leads; one Platform menu opens a panel split by a hairline: at the start a list of five products, each with an icon on a tile, a title and one line, and at the end a framed preview, a small greyscale drawing of that product (a latency chart, a hit-rate chart, a query chart, a propagation list or a trace) with a sentence under it. Hover or focus a row and its preview fades in; all five previews share one grid cell, so the panel never changes size while you move down the list. Pricing, Docs (the current page, marked by a foreground stroke on the bar's bottom edge) and Changelog follow as plain links, and Sign in and a Deploy now Shine Button close the row. Below the md breakpoint a menu button opens a sheet from the start edge with the five products as a flat list, the plain links and both actions; the preview is a pointer-and-keyboard nicety and isn't shown there. The panel and the sheet open over the page, so the block stays one bar high (56 pixels), and the bar draws no bottom border. It's built from Navigation Menu, Sheet, Guides, Shine Button and Button, with your theme's tokens for every colour. For platforms whose products are easier to choose when you can see what each one looks like.

FAQ

Is the preview accessible?

The preview is decoration: it is aria-hidden, holds no focusable parts, and repeats only what the product's row already says, so nothing is lost without it. Everything a visitor needs is in the list: each link has its title and description. Moving through the list with the keyboard moves the preview too, because focus sets it as hover does. The previews fade without moving, which reduced motion turns off.

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, each plain link, Sign in and Deploy now. Enter or Space opens the Platform menu, its button says whether it is expanded, and Escape closes it and puts focus back on Platform. Focus stays on Platform when the menu opens; Tab or the arrow keys move into the list. The arrow keys also move along the bar. The menu also opens on hover.

How does it work on a phone?

Below the md breakpoint the wordmark, Deploy now and a menu button stay on the bar, and nothing wraps at 320 pixels. The menu button says whether the menu is open and which panel it controls; it opens a sheet from the start edge (the left in a left-to-right page, the right in a right-to-left one) with a header that repeats the wordmark and a close button, the five products with their descriptions, the plain links with the current page tinted, and Sign in and Deploy now at the foot. Focus moves into the sheet and stays there; Escape, the close button or choosing a link closes it, and focus goes back to the menu button. A sheet taller than the screen scrolls.

Does choosing a link close the menu?

Yes, in the panel 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 product 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 Deploy now render the link they're given with render, with nativeButton={false}.

Why does the sheet read the page's direction?

A sheet's side is a physical edge (left or right), so a sheet that should come from the start of the line has to know which that is. The menu button's click handler reads its computed direction and picks the edge, so the sheet slides in from the right on a right-to-left page without a prop to set. If your app always reads one way, pass a fixed side.

  • 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 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.

  • Pro

    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.

  • 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 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 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.