ElementMenu
Index
Functions
_KeyDown
Parameters
rest...this: any
ev: KeyboardEvent
Returns Promise<void>
AppendButton
Parameters
menu: HTMLElement
The menubar
rest...menuitems: readonly HTMLElement[]
The to-be prepended menuitem
Returns void
Create
Parameters
id: string
The menu's ID
menuItems: readonly (string | Node | HTMLOptionsUnion)[]
The menu's content. Any
<button>element without a role (regardless of nesting) will be assigned themenuitemrole and thus be elligble for menu-style navigation. Buttons that open a sub-menu must have thearia-haspopup: "menu"attribute set and must be able to do so via a click action.optionaloptions: { direction: rtl | ltr; role: menu | menubar } = undefined
direction: rtl | ltr
The direction of the menu. Should match the value of the CSS
directionproperty if providedrole: menu | menubar
The role of the menu/menubar
optionalhtmlOptions: Partial<Record<menu, Omit<HTMLOptions<any>, tag>>> = undefined
Additional ElementCreate options to-be applied to the respective (child) element
Returns HTMLDivElement
- The menu
PrependItem
Parameters
menu: HTMLElement
The menubar
rest...menuitems: readonly HTMLElement[]
The to-be prepended menuitem
Returns void
Namespace for constructing menu bars