Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Minimal Navbar Block for React

The least navbar there is: a slim 48 px bar with a wordmark, three plain links and one Shine Button for a journaling app, with no motion, the current page marked by weight and a dot, and a bottom drawer 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 navbar for React with Base UI that does as little as a navbar can. The wordmark sits at the start, three links (Features, Privacy and Pricing) follow in small, muted text, and a Get the app Shine Button closes the row. Nothing moves and nothing is measured: a link darkens on hover and focus, and the page you're on has a heavier label with a small dot before it, with aria-current="page", so it isn't marked by colour alone. Below the md breakpoint the links fold into a menu button that opens a drawer from the bottom with the three links. The bar is 48 pixels high, draws no bottom border and takes its rails and top rule from the Guides spine. It has no state of its own, so it's a server component (the drawer keeps its own). It's built from Drawer, Guides, Shine Button and Button, with your theme's tokens for every colour. For apps, tools and single-purpose sites whose navigation is three links and one action.

FAQ

Why is it a server component?

Nothing in the bar needs state, effects or event handlers: the links are plain anchors and the drawer owns its open state, so the file has no "use client" and ships no script of its own beyond the catalog's Drawer and Shine Button, which are client components. If you add something that needs state, add the directive.

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 walks the wordmark, the three links and Get the app, and on a phone the menu button; a link takes a focus ring, and the current page is announced as the current page.

How does it work on a phone?

Below the md breakpoint Get the app and a menu button stay on the bar next to the wordmark, and nothing wraps at 320 pixels. The menu button opens a drawer from the bottom: a handle, a Menu title and the three links, the current page tinted with a dot. Drag it down, press Escape, tap the overlay or choose a link to close it; focus goes back to the menu button. The drawer is Base UI's, with its swipe handle; each link is the drawer's close part, rendered as a link with nativeButton={false}. Get the app renders the link it's given with render, with nativeButton={false}.

What happens with reduced motion?

Nothing in the bar moves, so there's nothing to reduce. The drawer opens without sliding and the band of light on Get the app fades in where it stands instead of sweeping.

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, and it draws no bottom border, because the next block's top rule is its bottom edge. To keep it in view while the page scrolls, add sticky top-0 z-40 bg-background/80 backdrop-blur to the header.

  • Pro

    Hover Highlight Navbar

    Link highlights

    A navbar for a tile shop whose five centred links share one soft block that glides to the link you hover or focus and fades out when you leave, with the current page marked by a heavier label and a dot instead.

  • Pro

    A one-bar navbar for a design studio whose links draw a hairline underline in from the inline start on hover and focus and retract it toward the end, with the current page keeping its full line, using nothing but a CSS transform.

  • Pro

    Floating Pill Navbar

    Surface and theme

    A detached opaque pill navbar that hugs its content and floats centred in the page column, with the call to action inside it and a drawer menu on phones.

  • Pro

    Centered Logo Navbar

    Cells and splits

    A symmetrical navbar with a centred wordmark in its own hairline cell between two link groups and a Bag link, and a sheet menu on phones.

  • Pro

    A one-bar navbar for a calendar assistant in beta: a Beta badge beside the wordmark, three plain links, and a Join the waitlist Shine Button that turns in place into an email field and then into a confirmation.

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