Skip to content
Klarhimmel UI

Navbar, open utility strip

Navbar, open utility strip previewNavbar, open utility strip preview

Install

npx shadcn add @klarhimmel/navbar-utility-open
DetailsAbout, usage, props and more

Two rows with every link open at every width: a plain top strip with up to three text links, a search field and one social icon, above the main row with the brand, the…

Import

Import

import Block from '@/components/klarhimmel/blocks/navbar-utility-open';
Also called
  • navigation/utility-open
  • header/utility-open
About
Two rows with every link open at every width: a plain top strip with up to three text links, a search field and one social icon, above the main row with the brand, the links centred 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

Pick it for a site whose few links should always be visible: a plain top strip with quiet links, a search field and one social icon, above a main row with the brand, centred links and one button. On a phone both rows stay and the links wrap, with no menu. Pick navbar-utility for a tinted strip with a note and a menu on a phone, and navbar-search for a shop header with a wide search and a category row.

Writing for it

- Brand up to 40 characters, up to three strip links and one icon label of 60 characters. - Main links 1 to 8, each label up to 40 characters; keep them short so they fit one line at 390. - Search label up to 60 characters names the field for screen readers; its placeholder up to 40.

Watch out for

Eight long links wrap into three or four lines on a phone and push the button down; keep labels to one or two words, and drop the strip search when the site has no search page to send it to.

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

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <NavbarUtilityOpen props={{
          "brand": "Brand name",
          "topLinks": [
            {
              "label": "Link one",
              "href": "#first"
            },
            {
              "label": "Link two",
              "href": "#second"
            }
          ],
          "search": {
            "label": "Name the search field for screen readers",
            "placeholder": "What to find"
          },
          "social": {
            "icon": "globe",
            "label": "Name the profile this icon opens",
            "href": "#profile"
          },
          "links": [
            {
              "label": "Page one",
              "href": "#first-page"
            },
            {
              "label": "Page two name",
              "href": "#second-page"
            },
            {
              "label": "Third page name",
              "href": "#third-page"
            }
          ],
          "cta": {
            "label": "Main action",
            "href": "#action"
          }
        }} />
      </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.
brandHrefstring-Text, up to 300 characters. Optional; empty is not rendered.
topLinksLink[]2 itemsList of up to 3. Optional; empty is not rendered.
search{ label, placeholder, action }{…}Fields: label, placeholder, action (optional). Optional; empty is not rendered.
social{ icon, label, href }{…}Fields: icon ('zap' | 'shield' | 'layers' | 'globe' | 'sparkles' | 'clock' | 'code' | 'palette' | 'lock' | 'chart' | 'users' | 'mail' | 'heart' | 'rocket' | 'search' | 'settings' | 'check' | 'star' | 'book' | 'box' | 'cloud' | 'compass' | 'leaf' | 'gauge'), label, href. Optional; empty is not rendered.
linksLink[]3 itemsList of 1 to 8.
ctaLink{…}See the type.