Skip to content
Klarhimmel UI

Navbar, utility bar

Navbar, utility bar previewNavbar, utility bar preview

Install

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

Two rows: a slim tinted utility bar (a note on the left, phone, language or sign-in links on the right) above the main row with brand, up to six links and one call to…

Import

Import

import Block from '@/components/klarhimmel/blocks/navbar-utility';
Also called
  • navigation/utility
  • header/utility
About
Two rows: a slim tinted utility bar (a note on the left, phone, language or sign-in links on the right) above the main row with brand, up to six links and one call to action.
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 two-row header for businesses with practical facts to show at all times, such as opening hours, a phone number or a language switch. If you have nothing to put in the thin top row, navbar-simple is cleaner.

Writing for it

- The note holds 80 characters on the left of the top row. Put one fact there, like delivery terms or opening hours, and leave it empty to hide it. - Utility takes up to three quiet links, such as a tel: link, a language link and a booking link. Short labels keep them on one line. - The brand is optional here (40 characters), which suits a site where a logo image is added by the host page instead.

Watch out for

The utility row is not part of the collapsing menu. In narrow containers the main row folds into a menu button while the top row stays, so a long note and three links can crowd a phone screen.

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

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <NavbarUtility props={{
          "brand": "Brand name",
          "note": "Say when people can reach you.",
          "utility": [
            {
              "label": "00 000 000 00",
              "href": "tel:+46310000000"
            },
            {
              "label": "Language",
              "href": "/sv"
            },
            {
              "label": "Your account",
              "href": "/booking"
            }
          ],
          "links": [
            {
              "label": "First page",
              "href": "#rooms"
            },
            {
              "label": "Second page",
              "href": "#breakfast"
            },
            {
              "label": "Third page",
              "href": "#offers"
            },
            {
              "label": "Fourth page",
              "href": "#directions"
            }
          ],
          "cta": {
            "label": "Main action",
            "href": "#book"
          }
        }} />
      </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.
notestring'Say when people can reach you.'Text, up to 80 characters. Optional; empty is not rendered.
utilityLink[]3 itemsList of up to 3. Optional; empty is not rendered.
linksLink[]4 itemsList of up to 10.
currentstring-Text, up to 300 characters. Optional; empty is not rendered.
ctaLink{…}See the type.
ctaInMenuboolean-Optional; empty is not rendered.