Skip to content
Klarhimmel UI

Navbar, menu panels

Navbar, menu panels previewNavbar, menu panels preview

Install

npx shadcn add https://ui.klarhimmel.com/r/navbar-menu.json
DetailsAbout, usage, props and more

Brand, up to four link groups that open a panel of described links, and one call to action. Panels become sections of the mobile menu.

Import

Import

import Block from '@/components/klarhimmel/blocks/navbar-menu';
Also called
  • navigation/menu
  • header/menu
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

A header for sites with enough pages that links need grouping, where each group opens a panel of links with a short description. For a flat list of a few links, use navbar-simple instead.

Writing for it

- Each group label holds 24 characters and the block takes one to four groups. The label is the only thing visible until the panel opens, so name it by the reader's task. - Every link in a panel has a label (40) and a description (100). Write the description as what the reader gets on that page, not a repeat of the label. - A group takes one to six links, but the panel lays them out in two or three columns on wide containers, so aim for an even count.

Watch out for

There is no plain link slot: every top-level entry is a group that must hold at least one link, so a single page such as Pricing has to be tucked into a group or left out.

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 NavbarMenu from '@/components/klarhimmel/blocks/navbar-menu';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <NavbarMenu props={{
          "brand": "Brand name",
          "groups": [
            {
              "label": "First group",
              "links": [
                {
                  "label": "First page",
                  "description": "Say what the first page is for.",
                  "href": "#planning"
                },
                {
                  "label": "Second page",
                  "description": "Say what the second page is for.",
                  "href": "#reviews"
                }
              ]
            },
            {
              "label": "Second group",
              "links": [
                {
                  "label": "First page",
                  "description": "Say what the first page is for.",
                  "href": "#guides"
                },
                {
                  "label": "Second page",
                  "description": "Say what the second page is for.",
                  "href": "#docs"
                }
              ]
            }
          ],
          "cta": {
            "label": "Main action",
            "href": "#start"
          }
        }} />
      </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.
groups{ label, links }[]3 itemsList of 1 to 4. Each item: label, links.
ctaLink{…}See the type.