Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Transparent Hero Navbar Block for React

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.

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 transparent navbar for React with Base UI, for a boutique hotel called Horizon Cove. The bar has no surface of its own: it lies over the top of the hero, a 160-pixel greyscale drawing of a page (a field of dots fading out toward the bar, a two-line headline and a booking card). A scrim behind the bar, the page colour fading to clear (bg-linear-to-b from-background), keeps the links readable over the dots in every theme: nothing is white-on-photo and nothing paints a dark scope. The wordmark leads, Stay, Rooms, Dining and Experiences follow, and Sign in and a Book a stay Shine Button close the row; below the md breakpoint a menu button opens a full-screen sheet with large links and both actions. It's built from Sheet, Dot Pattern, Guides, Shine Button and Button. For hotel, travel and brand sites whose first screen is a picture.

FAQ

How do I put it over my own hero?

Keep the header as it is (absolute inset-x-0 top-0 z-10 inside a relative box) and put your hero in that box: an image, a video or a gradient. The scrim behind the bar is the first child of the header; it's the page colour at full strength at the top edge, 80% at its middle and clear at the foot, so with a photograph the links keep a plain page-coloured band to sit on. Replace the drawn section with your hero and keep it aria-labelled or give it its own heading.

Does the text stay readable in every theme?

The links are the theme's own colours (muted until hovered, foreground for the current page) on the scrim, which is the theme's own background, so they keep their contrast in light and dark and in every preset. The dots are drawn at a low strength and fade out before the headline, and the hero's own text sits below the scrim. If you use a photograph, check the strip under the bar, and raise the scrim's strength if it's busy.

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, Book a stay and the menu button. The drawn hero is hidden from assistive technology. Book a stay renders the link it's given with render, with nativeButton={false}.

What does the phone menu look like?

Below the md breakpoint the wordmark and a menu button stay on the bar (Book a stay stays beside them from sm up and moves into the sheet below it, so nothing wraps at 320 pixels). The button opens a sheet from the top that fills the screen: its header lines up with the bar, the four links are large, with the current page tinted and dotted, and Book a stay and Sign in sit 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.

What moves, and what happens with reduced motion?

Nothing moves on load: the bar and the drawing are static and the dots don't react to the pointer. A band of light sweeps across Book a stay once on hover and keyboard focus, and the sheet slides down from the top. With reduced motion the sheet appears without sliding and the light fades in where it stands.

  • 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

    Glassmorphism Navbar

    Surface and theme

    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.

  • 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

    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

    Reverse Split News List Hero

    Updates and timelines

    A reverse split hero on drafting lines for a team docs workspace: a greyscale product illustration beside an announcement pill, the headline, a ruled list of the latest updates as links, a Shine Button and a second action.

  • Pro

    A centered showcase hero over a quiet monochrome mesh that drifts slowly behind the section, with a Shine Button, an outline button and a framed window of a moodboard canvas that runs on below the fold.