Skip to main content

MenuItemWithIcon class

📖 Description​

The MenuItemWithIcon class defines a menu item (with an icon) for the Menu class. A menu item is a selectable item in the menu that executes a function when tapped/clicked. It is derived from the MenuItem class.


🆕 constructor​

Creates a new MenuItemWithIcon instance.

Signature​

constructor(
icon: number,
label: string,
fn?: () => void,
disabled?: boolean
): MenuItemWithIcon

Parameters​

NameTypeOptionalDescription
iconnumberNoSpecifies the icon.
labelstringNoSpecifies the label.
fn() => voidYesSpecifies the command which is invoked when the item is selected.
disabledboolean = falseYesSpecifies if the item is disabled (default is false).

Return value​

Returns a reference to the new MenuItemWithIcon instance.