Skip to content

Menubar

Horizontal menu strip with arrow-key navigation across menus.

Menubar renders a horizontal role="menubar" command strip. Top-level triggers move with left/right arrows and each trigger can open a collision-aware vertical menu panel using the same MenuItem shape as Menu.

Anatomy

  • #trigger: Custom top-level trigger content.
  • #[item.slot]: Per-item render override for a top-level trigger or panel item.
  • #checkbox-item: Shared checkbox item renderer.
  • #radio-item: Shared radio item renderer.
  • #label: Shared label row renderer.

Usage

Examples

Radio groups

Pass radioValues for radio menu items. The event contract matches Menu.

vue
@layer akaza-reset;
@import "tailwindcss";
@import "akaza-ui/dist/akaza-ui.css";

Custom trigger

Use #trigger when top-level menu buttons need icons or badges.

vue
<template>
  <Avatar
    src="/avatar.jpg"
    alt="Jane Doe"
    text="JD"
    :delay-ms="300"
  />
</template>

Controlled menu and top-level actions

Plain items without children are commands. Bind default v-model to control the open top-level menu.

vue
<Button
  :ui="{
    root: 'rounded-md bg-black px-3 py-2 text-white',
    spinner: 'size-4 animate-spin',
  }"
>
  Save
</Button>

API Reference

Props

PropTypeDefaultDescription
itemsMenubarItem[]requiredTop-level menu items. Items with children open panels.
loopbooleantrueLeft/right focus wraps.
dir"ltr" | "rtl""ltr"Reverses horizontal arrow behavior for RTL.
teleportstring | false"body"Popup target. Set false for inline panels; ancestor overflow and stacking then apply.
disabledbooleanfalseDisables the menubar.
closeOnSelectbooleantrueCloses after normal item selection.
radioValuesRecord<string, string>—State for radio groups inside panels.
ariaLabelstring—Accessible label.
ariaLabelledbystring—Accessible label id.
uiMenubarUi—Classes for root, triggers, content, and menu parts.

Emits

EventPayloadDescription
open-change(value: string | null, details)Fired before active menu changes.
select(item, details)Fired when an item is selected.
check-change(item, checked, details)Fired when checkbox item changes.
radio-change(group, value, details)Fired when radio item changes.
update:radioValues(values)v-model event for radio state.

Slots

SlotPropsDescription
triggeritem, isOpenTop-level trigger content.
[item.slot]Depends on item typePer-item panel renderer.
checkbox-itemitem, checkedShared checkbox item renderer.
radio-itemitem, checkedShared radio item renderer.
labelitemShared label renderer.

UI Options

KeyDescription
rootrole="menubar" root.
triggerTop-level menu trigger button.
contentOpen menu panel wrapper.
panel, group, item, checkboxItem, radioItem, separator, label, submenu, submenuTrigger, submenuContentSame as Menu.

Styling Hooks

UI keyCSS classData attrs
rootakaza-menubardata-akaza-state, data-akaza-disabled
triggerakaza-menubar-triggerdata-akaza-state, data-akaza-disabled
contentakaza-menubar-content, akaza-menu-contentdata-akaza-state, data-akaza-side, data-akaza-align, --akaza-menubar-anchor-width, --akaza-menubar-anchor-height, --akaza-menubar-available-width, --akaza-menubar-available-height, --akaza-menubar-transform-origin, --akaza-menubar-duration
menu partsakaza-menu-*Same as Menu.

Popup transitions follow their placement side and last 120ms. Set --akaza-menubar-duration to change the duration. Reduced-motion mode removes the visible transition.

Keyboard

Submenus use Menu's viewport collision positioning. Horizontal arrows follow dir even when a submenu flips visually. Opening a submenu does not switch the top-level menu.

Menubar panels join the shared floating-layer stack and teleport to body by default so ancestor clipping and stacking contexts do not trap them. Set --akaza-z-layer-base (default 1200) globally to change its base or set --akaza-z-menubar on the popup to override its z-index. Use ui.content for popup styles; descendant selectors from the menubar root do not cross Teleport. Nested panels share Menu's styling hooks.

KeyBehavior
ArrowRight / ArrowLeftMove between top-level triggers.
ArrowDownOpen active menu and focus first panel item.
ArrowUpOpen active menu and focus last panel item.
Enter / SpaceOpen a menu or activate a top-level command without children.
ArrowUp / ArrowDownMove within an open panel.
Home / EndFocus first/last enabled top-level item.
Character keysTypeahead across top-level items.
EscapeClose the open panel and return focus to its trigger.
Edit this page on GitHub ↗