Navbar, overlay menu


Install
npx shadcn add @klarhimmel/navbar-overlay-menuDetailsAbout, 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
- 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
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
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.
| Prop | Type | Default | Description |
|---|---|---|---|
brand | string | 'Brand name' | Text, up to 40 characters. |
wordmark | Media | - | Optional; empty is not rendered. |
brandHref | string | - | Text, up to 300 characters. Optional; empty is not rendered. |
menuLabel | string | 'Open the menu' | Text, up to 24 characters. |
links | Link[] | 4 items | List of up to 8. |
cta | Link | {…} | See the type. |
secondary | Link | {…} | Optional; empty is not rendered. |
bar | 'split' | 'trio' | 'split' | One of 'split', 'trio'. Optional; empty is not rendered. |
action | Link | - | Optional; empty is not rendered. |