Menu
MenuHandle presents structured menu entries from a view anchor or explicit point.
Declare items and submenus
Section titled “Declare items and submenus”auto menu = UseMenu();
IconButton(images::more, "More actions") .With(menu.Anchor()) .OnClick([menu] { menu.Show({ MenuItem(images::edit, "Edit", Edit), MenuItem("Move to", { MenuItem("Archive", Archive), MenuItem("Favorites", AddToFavorites), }), MenuSection{}, MenuItem("Delete", Delete), }); })Leaf items contain a callback; parent items contain std::vector<MenuEntry> children. Icons may be ImageResource or ImageAsset. .Enabled(bool) and .Checked(bool) add state without changing entry structure. MenuSection marks a logical boundary; the active theme decides whether and how to draw separators.
Size and place the menu
Section titled “Size and place the menu”Natural width follows the widest entry subject to theme and viewport limits. Set MenuOptions::width only when the application requires a fixed width. MenuStyle owns item padding and height, foreground, indication, separators, surface, shadow, and motion.
Theme and accessibility
Section titled “Theme and accessibility”An open menu publishes a modal Menu collection and semantic MenuItem children.
Checked, disabled, and expanded submenu state is exposed to assistive technology, and compatible entries provide activate or expand actions.
UseMenu() -> MenuHandle;Anchor() -> LayerAnchor.Show(std::vector<MenuEntry>, MenuOptions = {})andShowAt(Point, ...).MenuItem(label, callback)and icon overloads.MenuItem(label, children)and icon overloads for submenus.Enabled(bool)andChecked(bool).MenuEntry,MenuSection,MenuOptions,MenuStyle, andMenuSeparatorMode.
See Popup for arbitrary anchored content.

