Skip to main content

MenuItem

Constructor

constructor();

Methods

setTitle

setTitle(title: string | DocumentFragment): this;

setIcon

setIcon(icon: IconName | null): this;

setChecked

setChecked(checked: boolean | null): this;

setDisabled

setDisabled(disabled: boolean): this;

setIsLabel

setIsLabel(isLabel: boolean): this;

onClick

onClick(callback: (evt: MouseEvent | KeyboardEvent) => any): this;

setSection

setSection(section: string): this;

Sets the section this menu item should belong in. To find the section IDs of an existing menu, inspect the DOM elements to see their data-section attribute.