where to position the menu: a screen point (e.g. a right-click location), a DOMRect, or an element to anchor to. An element is measured when the menu opens.
Optionalclassmaps default class names to custom ones (e.g. for css modules); defaults to identity
Optionalcontainerelement the menu is positioned within and portalled into; defaults to the anchor's document body. Should be a positioned element (e.g. the FlexLayout root) for precise placement.
the menu entries (selectable items and/or dividers)
called when the menu closes (selection, Escape/Tab, outside click, or programmatic hide)
Optionaloncalled with the chosen item when one is selected
Optionalrendercustom renderer for an item; must render an element with role="menuitem" and tabIndex=-1
Optionalreturnelement to return focus to when the menu closes; defaults to the anchor when it is an element
Optionaltitleaccessible label for the menu
Props for the reusable PopupMenu control and the showPopupMenu helper. The control has no dependency on the layout model - it can be used as a standalone menu/context menu.