AppDropdownMenu
A menu button (APG Menu Button) on top of AppPopover. Enter, Space or Down opens it on the first item, Up on the last; inside, the arrows, Home, End and type-ahead move, Enter or Space runs an item, Escape closes and returns focus to the trigger, and Tab closes and moves on. Items can carry an icon, a shortcut hint and a danger tone; groups get a heading and separators; checkbox and radio items keep the menu open.
Install: pnpm add-component AppDropdownMenu
Basic usage
MenuItem: { label, type?, icon?, shortcut?, danger?, disabled?, checked?, onSelect? }. The menu also emits select with the item.
Checkbox and radio items
They toggle and leave the menu open; the state is yours, passed back as checked.
Custom trigger
Bind attrs on your own button: it carries the id, aria-haspopup, aria-expanded, aria-controls and the click and arrow-key handlers. An icon-only trigger needs its own aria-label.
API
items((MenuItem | MenuGroup)[]): Items, and groups { label?, items } that are split off by separators.label(string): Text of the default trigger, which also names the menu.icon(string): Leading icon of the default trigger.placement('bottom-start' | 'bottom-end' | 'top-start' | 'top-end'): Where the menu opens; it flips when there is no room.disabled(boolean): Disables the trigger.