Skip to content
Nana UI

Menubar

An application-style menu bar — a horizontal row of nana-menubar-menu top-level menus (File, Edit, View…), each opening a dropdown of nana-menu-item rows. Implements the WAI-ARIA menubar pattern: roving tabindex across the triggers, arrow-key switching between menus (with the open panel following), hover-to-switch once a menu is open, and dismissal on outside click or Escape.

New Open Close Undo Redo
Terminal window
npm install @nana-tec/ui-components
import "@nana-tec/ui-components/menubar";
<nana-menubar bordered>
<nana-menubar-menu label="File">
<nana-menu-item value="new" shortcut="⌘N">New</nana-menu-item>
<nana-menu-item value="open" shortcut="⌘O">Open</nana-menu-item>
</nana-menubar-menu>
</nana-menubar>
PropertyTypeDefaultDescription
borderedbooleanfalseBordered shell — a self-contained app menu bar
EventTypeDescription
nana-selectCustomEventBubbled from a chosen item (detail.value)
SlotDescription
(default)nana-menubar-menu children
VariableDefaultDescription
--nana-menubar-bgBar background
--nana-menubar-gapGap between top-level menus
PartDescription
barThe horizontal bar container
  • Keyboard accessible
  • Screen-reader labels
  • Focus-visible states
  • ARIA roles and states
  • WCAG 2.2 AA contrast
Explore Menubar interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook