# Navbar, overlay menu

- **[Sections](/blocks/)**
- **[Navigation](/blocks/navigation/)**
- **Navbar, overlay menu**

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

- **CLI**

  ```
  npx shadcn add @klarhimmel/navbar-overlay-menu
  ```
- **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.

## Pairs well with

- **[Hero, split](/blocks/hero/split)**
- **[Call to action, band](/blocks/cta/banner)**
- **[Footer, simple](/blocks/footer/simple)**

## 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.

- **brand**: Text, up to 40 characters.
- **wordmark**: Optional; empty is not rendered.
- **brandHref**: Text, up to 300 characters. Optional; empty is not rendered.
- **menuLabel**: Text, up to 24 characters.
- **links**: List of up to 8.
- **cta**: See the type.
- **secondary**: Optional; empty is not rendered.
- **bar**: One of 'split', 'trio'. Optional; empty is not rendered.
- **action**: Optional; empty is not rendered.

[Previous](/blocks/navigation/menu)

[Next](/blocks/navigation/search)
