Skip to main content

MenuItemWithImage class

📖 Description

The MenuItemWithImage class defines a menu item (with an image) 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 MenuItemWithImage instance.


image: string,
label: string,
fn?: () => void,
disabled?: boolean
): MenuItemWithImage


imagestringNoSpecifies the image.
labelstringNoSpecifies the label.
fn() => voidYesSpecifies the command which is invoked when the item is selected.
disabledbooleanYesSpecifies if the item is disabled (default is false).

Return value

Returns a reference to the new MenuItemWithImage instance.