Skip to content
Klarhimmel UI

Navbar, overlay menu

Navbar, overlay menu previewNavbar, overlay menu preview

Install

npx shadcn add @klarhimmel/navbar-overlay-menu
DetailsAbout, usage, props and more

A bar that stays collapsed at every width, brand with a menu toggle (or toggle, brand and a round icon link), opening a panel of large links and actions under the bar…

Import

Import

import Block from '@/components/klarhimmel/blocks/navbar-overlay-menu';
Also called
  • navigation/overlay-menu
  • header/overlay-menu
About
A bar that stays collapsed at every width, brand with a menu toggle (or toggle, brand and a round icon link), opening a panel of large links and actions under the bar with no script.
Category
The bar at the top of every page: brand, links, one action. New project? Set it up once: /get-started/installation.

Notes

When to use it

Pick it when the bar stays collapsed at every width and the menu opens as a panel of large links, as on a studio or portfolio site. Pick navbar-simple for a bar whose links stay visible on wide screens, or navbar-menu for grouped dropdown panels.

Writing for it

- Brand up to 40 characters, menuLabel up to 24, never drawn, only the toggle's name. - Up to 8 links of 40 characters, short enough to read at display size. - Bar split puts the brand left and toggle right; trio adds a round icon link whose label names what it does.

Watch out for

The panel stays closed until the toggle is checked, so a page with two of these shares one toggle id; use one per page. Keep link labels to a word or two or the large type wraps.

Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import NavbarOverlayMenu from '@/components/klarhimmel/blocks/navbar-overlay-menu';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <NavbarOverlayMenu props={{
          "brand": "Brand name",
          "menuLabel": "Open the menu",
          "links": [
            {
              "label": "Name the first page",
              "href": "#first"
            },
            {
              "label": "Name the second page",
              "href": "#second"
            },
            {
              "label": "Name the third page",
              "href": "#third"
            },
            {
              "label": "Name the fourth page",
              "href": "#fourth"
            }
          ],
          "cta": {
            "label": "Main action",
            "href": "#start"
          },
          "secondary": {
            "label": "Second action",
            "href": "#more"
          },
          "bar": "split"
        }} />
      </BlockSurface>
    </Theme>
  );
}

Props

The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.

PropTypeDefaultDescription
brandstring'Brand name'Text, up to 40 characters.
wordmarkMedia-Optional; empty is not rendered.
brandHrefstring-Text, up to 300 characters. Optional; empty is not rendered.
menuLabelstring'Open the menu'Text, up to 24 characters.
linksLink[]4 itemsList of up to 8.
ctaLink{…}See the type.
secondaryLink{…}Optional; empty is not rendered.
bar'split' | 'trio''split'One of 'split', 'trio'. Optional; empty is not rendered.
actionLink-Optional; empty is not rendered.