reactintermediatemitFeatured

React Glass Navbar

A frosted-glass navbar as a React component.

7.8k2.7k1.4k513

About this module

A React navbar with backdrop blur, responsive mobile menu and proper ARIA. Includes a sticky variant toggle.

#react#navbar#glass#responsive

Source code

Installation

  1. 1

    Install dependencies

    Install React and the required packages.

    npm install react react-dom
  2. 2

    Create the component

    Create ReactGlassNavbar.tsx and paste the source below.

  3. 3

    Create the styles

    Create `styles.css` alongside the component and import it from the component file.

  4. 4

    Import and use

    Import the component in your page or layout and render it.

Usage

  1. 1

    Import the component

    Import ReactGlassNavbar from its file.

    import ReactGlassNavbar from "./components/ReactGlassNavbar";
  2. 2

    Render it

    Render the component in your JSX.

    export default function App() {
      return <ReactGlassNavbar />;
    }
Overview
Categorycomponents
Frameworkreact
Difficultyintermediate
Licensemit
Versionv1.0.0
Features
  • TypeScript-ready
  • Accessible by default
  • Component-scoped styles
Traits
  • ResponsiveYes
  • Dark modeYes
  • AccessibleYes
  • Production readyYes
Props
links{ label: string; href: string }[]

Navigation links to render.

Default: []

brandstring

Brand name shown on the left.

Default: "Acme"

ctaLabelstring

Text of the right-aligned CTA.

Default: "Get started"

stickyboolean

Whether the navbar sticks to the top.

Default: true

Browser support
  • Chrome 90+
  • Firefox 90+
  • Safari 15+
  • Edge 90+

Related modules

Command Palette

Search modules and jump anywhere