MiHCM
navigation/@mihcm/ui·v0.21.0·stable

Menubar

Horizontal menu bar with dropdown menus, powered by Radix. Supports density, surfaces, alignment, dropdown sizing, portal behavior, animation, item tones, shortcuts, checkbox/radio items, and submenus.

WCAG 2.1 AA — release blocker

Menubar must satisfy these on every render before it ships.

Semantics

  • The root element renders role="menubar".
  • Each trigger renders role="menuitem" within the menubar.
  • Dropdown content renders role="menu" with role="menuitem" children.
  • Checkbox items use role="menuitemcheckbox" with aria-checked.
  • Radio items use role="menuitemradio" with aria-checked.

Keyboard navigation

KeyAction
Arrow Left / RightMove focus between top-level menu triggers.
Arrow DownOpen the focused menu and move to the first item.
Arrow UpMove to the previous item in an open menu.
Enter / SpaceActivate the focused menu item.
EscapeClose the current menu and return focus to the trigger.
Type-aheadTyping a character moves focus to the next matching item.

Focus management

  • Focus starts on the first trigger in the menubar.
  • When a menu opens, focus moves to the first item inside it.
  • When a menu closes, focus returns to the trigger that opened it.
  • Focus wraps within a menu (last item arrows to first and vice versa).

Labelling

  • Each MenubarTrigger serves as the accessible name for its menu.
  • MenubarShortcut is rendered with aria-hidden — it is a visual hint, not announced.

Disabled state

  • Disabled items have aria-disabled="true" and are skipped during keyboard navigation.
  • Disabled items are visually de-emphasized with reduced opacity.

Audit checklist

  • Root has role="menubar"
  • Menus have role="menu" with role="menuitem" children
  • Arrow keys navigate between menus and within items
  • Escape closes the current menu
  • Type-ahead moves focus to matching items
  • Checkbox items toggle aria-checked
  • Radio items reflect aria-checked within their group
  • Focus ring visible on all interactive elements
  • 4.5:1 contrast on menu items