Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Glassmorphism Navbar Block for React

A frosted rectangular navbar panel inset in the page column, lying over a band of slowly drifting dots and soft mesh so the blur is visible, with a drawer menu 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 glass navbar for React with Base UI, for a photo-editing suite called Prismveil. The bar is a rounded rectangle, a frosted panel (backdrop-blur-xl bg-background/70 with a ring for its edge), inset in the page column over a 112-pixel band of texture: a soft mesh of the theme's foreground tones and a field of dots whose wave drifts slowly across it. The dots stay sharp around the panel and melt into the glass behind it, which is what makes the blur visible. The wordmark leads, Editor, Presets, Gallery and Pricing follow, and Sign in and a Try it free Shine Button close the row; below the md breakpoint a menu button opens a drawer from the bottom with the links and both actions. It's built from Mesh Gradient, Dot Pattern, Drawer, Guides, Shine Button and Button. For creative tools and media sites whose header sits over a textured or photographic page.

FAQ

Can I put a photo or another background behind it?

Yes. The band is an aria-hidden layer behind the panel (the mesh and the dots inside the -z-10 wrapper): swap it for an image, a video or a gradient and keep the panel. The panel needs something with detail behind it to look like glass, so a flat page colour shows no blur. The wrapper's mask fades the band out toward its foot, so the bar's bottom edge, which is the next block's top rule, isn't cut by a hard edge.

Does the text stay readable over the texture?

The panel is 70% page colour, blurred, and the mesh is held to a quarter of its strength in foreground tones with no hue, so the links keep their contrast in light and dark and in every preset. If you put a busier image behind it, raise the panel to bg-background/80 or lower the image's strength rather than darkening the links.

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

The links sit in a nav named Main after the wordmark (a link home), the current page is aria-current="page", and Tab walks the wordmark, the links, Sign in, Try it free and the menu button. The band is hidden from assistive technology and takes no pointer or focus. Try it free renders the link it's given with render, with nativeButton={false}.

How does it work on a phone?

Below the md breakpoint the wordmark, Try it free and a menu button stay in the panel. The button opens a drawer from the bottom with a grabber, the four links (the current page tinted and dotted), then Sign in and Try it free. Focus moves into the drawer and stays there; Escape, a swipe down, a tap outside it or choosing a link closes it, and focus goes back to the menu button.

What moves, and what happens with reduced motion?

The mesh drifts and a diagonal wave crosses the dots, both so slowly you barely see them move, and a band of light sweeps across Try it free once on hover and keyboard focus. With reduced motion the mesh and the dots rest where they start, the drawer appears without sliding and the light fades in where it stands. The dots don't react to the pointer.

  • Pro

    Sticky Blur Navbar

    Surface and theme

    A navbar stuck to the top of a scrolling page preview: clear at rest, frosted with a hairline once the page moves under it, with a sheet menu on phones.

  • Pro

    Transparent Hero Navbar

    Surface and theme

    A transparent navbar laid over a hero drawing, with a scrim behind it that keeps the links readable in every theme, and a full-screen sheet on phones.

  • 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

    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

    Drill-Down Drawer Navbar

    Mobile and drawers

    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.

  • Pro

    A compact card-in-card hero on solid rails: a frosted glass panel with a ring over a drifting mesh of your accent's tones, in a hairline frame with + marks, with a Shine Button and an outline button.