Navbar

Navigation bar

Marketing BlockNavigation

Overview

A compound sticky navbar component. Desktop links use Radix UI NavigationMenu with dropdown and mega-menu support. The mobile menu renders a slide-in drawer with two-level navigation (drill-down).

Usage

import { Navbar } from "@leanicon/web-builder-library";

Default

Simple navbar with plain links, action buttons, and a mobile hamburger menu.

With dropdowns

Links with children render as dropdown menus.

With mega-menu

Links with megaMenu render a full-width categorized panel with optional badges, descriptions, indicators, and footer links.

Minimal trigger variant

Set triggerVariant="minimal" for transparent trigger buttons without background.

Mobile view

Pass className="!block" to Navbar.MobileMenu to force the hamburger visible regardless of viewport width. Desktop links and actions are hidden on mobile via hidden md:flex.

Mobile view with dropdowns

Mobile view with mega-menu

Dark mode

With mega-menu — dark mode

Sub-components

Sub-component

Props

Description

Navbar.Logo

src, alt, href?

Brand logo link

Navbar.Links

items, triggerVariant?

Desktop nav links with dropdowns

Navbar.Actions

children

CTA buttons/links (hidden on mobile)

Navbar.MobileMenu

items, children?

Hamburger + slide-in drawer

Props

Prop

Type

Default

Description

children

React.ReactNode

—

Sub-components (required)

linkComponent

React.ElementType

"a"

Custom link component (e.g. Next.js Link)

colorScheme

"light" | "dark"

—

Force light or dark mode

className

string

—

Additional CSS classes on root

Notes

  • Navbar.Links accepts triggerVariant="minimal" for transparent trigger buttons.
  • NavMegaMenuItem supports badge (pill), description (subtitle), and indicator (colored dot).
  • The mega-menu renders full-width with up to 3 category columns and optional footer links.
  • The mobile drawer supports drill-down navigation for both children and megaMenu items.
  • linkComponent prop enables custom link components (e.g. Next.js Link) for SPA navigation.
  • Dark mode: pass colorScheme="dark" or place inside a .dark ancestor.

Props

NameTypeDefaultRequiredDescription
colorSchemeenum—No
classNamestring—No
linkComponentElementType<any, keyof IntrinsicElements>aNoCustom link component (e.g. Next.js Link) used for all internal navigation. Defaults to `"a"`.
srcstring—Yes
altstring—Yes
widthnumber—No
heightnumber—No
priorityboolean—NoLikely LCP element — threaded from block adapters (spec 007, Research D5).
hrefstring/No
itemsNavLinkItem[]—Yes
triggerVariantenumdefaultNo