Creates a TopMenu. Styles are injected once.
Element to append the menu into. Must establish a stacking context so CSS variables are inherited.
Optional class-name overrides.
Protected ReadonlyhostProtected ReadonlyconfigProtectedtargetProtectedmenuProtectedtopThe top-level menu items, including both dropdowns and individual items.
ProtecteddropAll dropdown menus, extracted from the top-level items.
Protected OptionalselectedThe currently selected dropdown menu, if any.
Protected OptionalactiveThe currently opened dropdown menu, if any.
Protected OptionalselectedThe currently selected menu item, if any. This may be a top-level dropdown or a menu item inside a dropdown.
Returns true when the menu is currently visible.
Permanently removes the menu and cleans up listeners.
Optionalparent: HTMLElementOptionalparent: HTMLElementProtectedaddAppends a visual separator line.
Optionalparent: HTMLElementHides any visible dropdown menus.
Lightweight context menu that renders at fixed viewport coordinates.