Accessibility

  • Roles: the trigger is a <button> with a name ("Project options"), aria-haspopup="menu", aria-expanded and aria-controls. The list is role="menu", named by the trigger with aria-labelledby; each item is a <button role="menuitem"> in an li role="none"; the separator is role="separator".
  • Keyboard: Enter, Space or Down arrow on the trigger opens the menu on the first item, Up arrow on the last. Down and Up move between items and wrap; Home and End jump to the ends; Enter or Space runs the action and closes the menu. Escape closes it and returns focus to the trigger; Tab closes it and moves on.
  • Shortcuts: show the keys in k-menu__shortcut, hidden from screen readers, and expose them with aria-keyshortcuts.
  • Targets: items are 44px tall across the full menu width, above the 32px web minimum (size-control-sm).
  • Contrast: labels, ink on surface, 17.4:1 in light and 14.4:1 in dark; icons and shortcuts, ink-muted on surface, 6.7:1 and 8.1:1; the critical item, critical on surface, 6.5:1 and 10.0:1.
  • Motion: the menu fades in and out over --k-motion-medium (300ms); nothing slides. The hover layer fades in 150ms.