Skip to content

menu

A native Icon to be used for the menu item

  • Windows / Linux: Unsupported.

Add: "Add";

An add item template image.

Advanced: "Advanced";

Advanced preferences toolbar icon for the preferences window.

Bluetooth: "Bluetooth";

A Bluetooth template image.

Bookmarks: "Bookmarks";

Bookmarks image suitable for a template.

Caution: "Caution";

A caution image.

ColorPanel: "ColorPanel";

A color panel toolbar icon.

ColumnView: "ColumnView";

A column view mode template image.

Computer: "Computer";

A computer icon.

EnterFullScreen: "EnterFullScreen";

An enter full-screen mode template image.

Everyone: "Everyone";

Permissions for all users.

ExitFullScreen: "ExitFullScreen";

An exit full-screen mode template image.

FlowView: "FlowView";

A cover flow view mode template image.

Folder: "Folder";

A folder image.

FolderBurnable: "FolderBurnable";

A burnable folder icon.

FolderSmart: "FolderSmart";

A smart folder icon.

FollowLinkFreestanding: "FollowLinkFreestanding";

A link template image.

FontPanel: "FontPanel";

A font panel toolbar icon.

GoLeft: "GoLeft";

A go back template image.

GoRight: "GoRight";

A go forward template image.

Home: "Home";

Home image suitable for a template.

IChatTheater: "IChatTheater";

An iChat Theater template image.

IconView: "IconView";

An icon view mode template image.

Info: "Info";

An information toolbar icon.

InvalidDataFreestanding: "InvalidDataFreestanding";

A template image used to denote invalid data.

LeftFacingTriangle: "LeftFacingTriangle";

A generic left-facing triangle template image.

ListView: "ListView";

A list view mode template image.

LockLocked: "LockLocked";

A locked padlock template image.

LockUnlocked: "LockUnlocked";

An unlocked padlock template image.

MenuMixedState: "MenuMixedState";

A horizontal dash, for use in menus.

MenuOnState: "MenuOnState";

A check mark template image, for use in menus.

MobileMe: "MobileMe";

A MobileMe icon.

MultipleDocuments: "MultipleDocuments";

A drag image for multiple items.

Network: "Network";

A network icon.

Path: "Path";

A path button template image.

PreferencesGeneral: "PreferencesGeneral";

General preferences toolbar icon for the preferences window.

QuickLook: "QuickLook";

A Quick Look template image.

Refresh: "Refresh";

A refresh template image.

RefreshFreestanding: "RefreshFreestanding";

A refresh template image.

Remove: "Remove";

A remove item template image.

RevealFreestanding: "RevealFreestanding";

A reveal contents template image.

RightFacingTriangle: "RightFacingTriangle";

A generic right-facing triangle template image.

Share: "Share";

A share view template image.

Slideshow: "Slideshow";

A slideshow template image.

SmartBadge: "SmartBadge";

A badge for a smart item.

StatusAvailable: "StatusAvailable";

Small green indicator, similar to iChat’s available image.

StatusNone: "StatusNone";

Small clear indicator.

StatusPartiallyAvailable: "StatusPartiallyAvailable";

Small yellow indicator, similar to iChat’s idle image.

StatusUnavailable: "StatusUnavailable";

Small red indicator, similar to iChat’s unavailable image.

StopProgress: "StopProgress";

A stop progress button template image.

StopProgressFreestanding: "StopProgressFreestanding";

A stop progress template image.

TrashEmpty: "TrashEmpty";

An image of the empty trash can.

TrashFull: "TrashFull";

An image of the full trash can.

User: "User";

Permissions for a single user.

UserAccounts: "UserAccounts";

User account toolbar icon for the preferences window.

UserGroup: "UserGroup";

Permissions for a group of users.

UserGuest: "UserGuest";

Permissions for guests.

A check menu item inside a Menu or Submenu and usually contains a text and a check mark or a similar toggle that corresponds to a checked and unchecked states.

  • MenuItemBase

get id(): string

The id of this item.

string

MenuItemBase.id

get rid(): number

number

MenuItemBase.rid

close(): Promise<void>

Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.

Promise<void>

MenuItemBase.close

isChecked(): Promise<boolean>

Returns whether this check menu item is checked or not.

Promise<boolean>

isEnabled(): Promise<boolean>

Returns whether this check menu item is enabled or not.

Promise<boolean>

setAccelerator(accelerator): Promise<void>

Sets the accelerator for this check menu item.

ParameterType
acceleratornull | string

Promise<void>

setChecked(checked): Promise<void>

Sets whether this check menu item is checked or not.

ParameterType
checkedboolean

Promise<void>

setEnabled(enabled): Promise<void>

Sets whether this check menu item is enabled or not.

ParameterType
enabledboolean

Promise<void>

setText(text): Promise<void>

Sets the text for this check menu item.

ParameterType
textstring

Promise<void>

text(): Promise<string>

Returns the text of this check menu item.

Promise<string>

static new(opts): Promise<CheckMenuItem>

Create a new check menu item.

ParameterType
optsCheckMenuItemOptions

Promise<CheckMenuItem>


An icon menu item inside a Menu or Submenu and usually contains an icon and a text.

  • MenuItemBase

get id(): string

The id of this item.

string

MenuItemBase.id

get rid(): number

number

MenuItemBase.rid

close(): Promise<void>

Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.

Promise<void>

MenuItemBase.close

isEnabled(): Promise<boolean>

Returns whether this icon menu item is enabled or not.

Promise<boolean>

setAccelerator(accelerator): Promise<void>

Sets the accelerator for this icon menu item.

ParameterType
acceleratornull | string

Promise<void>

setEnabled(enabled): Promise<void>

Sets whether this icon menu item is enabled or not.

ParameterType
enabledboolean

Promise<void>

setIcon(icon): Promise<void>

Sets an icon for this icon menu item

ParameterType
icon| null | string | number[] | ArrayBuffer | Uint8Array<ArrayBufferLike> | Image

Promise<void>

setText(text): Promise<void>

Sets the text for this icon menu item.

ParameterType
textstring

Promise<void>

text(): Promise<string>

Returns the text of this icon menu item.

Promise<string>

static new(opts): Promise<IconMenuItem>

Create a new icon menu item.

ParameterType
optsIconMenuItemOptions

Promise<IconMenuItem>


A type that is either a menu bar on the window on Windows and Linux or as a global menu in the menubar on macOS.

  • macOS: if using Menu for the global menubar, it can only contain Submenus.
  • MenuItemBase

get id(): string

The id of this item.

string

MenuItemBase.id

get rid(): number

number

MenuItemBase.rid

append<T>(items): Promise<void>

Add a menu item to the end of this menu.

Type Parameter
T extends | CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | SubmenuOptions | PredefinedMenuItemOptions | IconMenuItemOptions | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem
ParameterType
itemsT | T[]

Promise<void>

close(): Promise<void>

Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.

Promise<void>

MenuItemBase.close

get(id): Promise<
| null
| CheckMenuItem
| IconMenuItem
| PredefinedMenuItem
| Submenu
| MenuItem>

Retrieves the menu item matching the given identifier.

ParameterType
idstring

Promise< | null | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem>

insert<T>(items, position): Promise<void>

Add a menu item to the specified position in this menu.

Type Parameter
T extends | CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | SubmenuOptions | PredefinedMenuItemOptions | IconMenuItemOptions | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem
ParameterType
itemsT | T[]
positionnumber

Promise<void>

items(): Promise<(
| CheckMenuItem
| IconMenuItem
| PredefinedMenuItem
| Submenu
| MenuItem)[]>

Returns a list of menu items that has been added to this menu.

Promise<( | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem)[]>

popup(at?, window?): Promise<void>

Popup this menu as a context menu on the specified window.

ParameterTypeDescription
at?LogicalPosition | PhysicalPosition | PositionIf a position is provided, it is relative to the window’s top-left corner. If there isn’t one provided, the menu will pop up at the current location of the mouse.
window?Window-

Promise<void>

prepend<T>(items): Promise<void>

Add a menu item to the beginning of this menu.

Type Parameter
T extends | CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | SubmenuOptions | PredefinedMenuItemOptions | IconMenuItemOptions | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem
ParameterType
itemsT | T[]

Promise<void>

remove(item): Promise<void>

Remove a menu item from this menu.

ParameterType
item| CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem

Promise<void>

removeAt(position): Promise<
| null
| CheckMenuItem
| IconMenuItem
| PredefinedMenuItem
| Submenu
| MenuItem>

Remove a menu item from this menu at the specified position.

ParameterType
positionnumber

Promise< | null | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem>

setAsAppMenu(): Promise<null | Menu>

Sets the app-wide menu and returns the previous one.

If a window was not created with an explicit menu or had one set explicitly, this menu will be assigned to it.

Promise<null | Menu>

setAsWindowMenu(window?): Promise<null | Menu>

Sets the window menu and returns the previous one.

  • macOS: Unsupported. The menu on macOS is app-wide and not specific to one window, if you need to set it, use Menu.setAsAppMenu instead.
ParameterType
window?Window

Promise<null | Menu>

static default(): Promise<Menu>

Create a default menu.

Promise<Menu>

static new(opts?): Promise<Menu>

Create a new menu.

ParameterType
opts?MenuOptions

Promise<Menu>


A menu item inside a Menu or Submenu and contains only text.

  • MenuItemBase

get id(): string

The id of this item.

string

MenuItemBase.id

get rid(): number

number

MenuItemBase.rid

close(): Promise<void>

Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.

Promise<void>

MenuItemBase.close

isEnabled(): Promise<boolean>

Returns whether this menu item is enabled or not.

Promise<boolean>

setAccelerator(accelerator): Promise<void>

Sets the accelerator for this menu item.

ParameterType
acceleratornull | string

Promise<void>

setEnabled(enabled): Promise<void>

Sets whether this menu item is enabled or not.

ParameterType
enabledboolean

Promise<void>

setText(text): Promise<void>

Sets the text for this menu item.

ParameterType
textstring

Promise<void>

text(): Promise<string>

Returns the text of this menu item.

Promise<string>

static new(opts): Promise<MenuItem>

Create a new menu item.

ParameterType
optsMenuItemOptions

Promise<MenuItem>


A predefined (native) menu item which has a predefined behavior by the OS or by tauri.

  • MenuItemBase

get id(): string

The id of this item.

string

MenuItemBase.id

get rid(): number

number

MenuItemBase.rid

close(): Promise<void>

Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.

Promise<void>

MenuItemBase.close

setText(text): Promise<void>

Sets the text for this predefined menu item.

ParameterType
textstring

Promise<void>

text(): Promise<string>

Returns the text of this predefined menu item.

Promise<string>

static new(opts?): Promise<PredefinedMenuItem>

Create a new predefined menu item.

ParameterType
opts?PredefinedMenuItemOptions

Promise<PredefinedMenuItem>


A type that is a submenu inside a Menu or Submenu.

  • MenuItemBase

get id(): string

The id of this item.

string

MenuItemBase.id

get rid(): number

number

MenuItemBase.rid

append<T>(items): Promise<void>

Add a menu item to the end of this submenu.

Type Parameter
T extends | CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | SubmenuOptions | PredefinedMenuItemOptions | IconMenuItemOptions | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem
ParameterType
itemsT | T[]

Promise<void>

close(): Promise<void>

Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.

Promise<void>

MenuItemBase.close

get(id): Promise<
| null
| CheckMenuItem
| IconMenuItem
| PredefinedMenuItem
| Submenu
| MenuItem>

Retrieves the menu item matching the given identifier.

ParameterType
idstring

Promise< | null | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem>

insert<T>(items, position): Promise<void>

Add a menu item to the specified position in this submenu.

Type Parameter
T extends | CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | SubmenuOptions | PredefinedMenuItemOptions | IconMenuItemOptions | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem
ParameterType
itemsT | T[]
positionnumber

Promise<void>

isEnabled(): Promise<boolean>

Returns whether this submenu is enabled or not.

Promise<boolean>

items(): Promise<(
| CheckMenuItem
| IconMenuItem
| PredefinedMenuItem
| Submenu
| MenuItem)[]>

Returns a list of menu items that has been added to this submenu.

Promise<( | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem)[]>

popup(at?, window?): Promise<void>

Popup this submenu as a context menu on the specified window.

If the position, is provided, it is relative to the window’s top-left corner.

ParameterType
at?LogicalPosition | PhysicalPosition
window?Window

Promise<void>

prepend<T>(items): Promise<void>

Add a menu item to the beginning of this submenu.

Type Parameter
T extends | CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | SubmenuOptions | PredefinedMenuItemOptions | IconMenuItemOptions | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem
ParameterType
itemsT | T[]

Promise<void>

remove(item): Promise<void>

Remove a menu item from this submenu.

ParameterType
item| CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem

Promise<void>

removeAt(position): Promise<
| null
| CheckMenuItem
| IconMenuItem
| PredefinedMenuItem
| Submenu
| MenuItem>

Remove a menu item from this submenu at the specified position.

ParameterType
positionnumber

Promise< | null | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem>

setAsHelpMenuForNSApp(): Promise<void>

Set this submenu as the Help menu for the application on macOS.

This will cause macOS to automatically add a search box to the menu.

If no menu is set as the Help menu, macOS will automatically use any menu which has a title matching the localized word “Help”.

  • Windows / Linux: Unsupported.

Promise<void>

setAsWindowsMenuForNSApp(): Promise<void>

Set this submenu as the Window menu for the application on macOS.

This will cause macOS to automatically add window-switching items and certain other items to the menu.

  • Windows / Linux: Unsupported.

Promise<void>

setEnabled(enabled): Promise<void>

Sets whether this submenu is enabled or not.

ParameterType
enabledboolean

Promise<void>

setText(text): Promise<void>

Sets the text for this submenu.

ParameterType
textstring

Promise<void>

text(): Promise<string>

Returns the text of this submenu.

Promise<string>

static new(opts): Promise<Submenu>

Create a new submenu.

ParameterType
optsSubmenuOptions

Promise<Submenu>

A metadata for the about predefined menu item.

PropertyTypeDescriptionDefined in
authors?string[]The authors of the application. #### Platform-specific - macOS: Unsupported.
comments?stringApplication comments. #### Platform-specific - macOS: Unsupported.
copyright?stringThe copyright of the application.
credits?stringThe credits. #### Platform-specific - Windows / Linux: Unsupported.
icon?| string | number[] | ArrayBuffer | Uint8Array<ArrayBufferLike> | ImageThe application icon. #### Platform-specific - Windows: Unsupported.
license?stringThe license of the application. #### Platform-specific - macOS: Unsupported.
name?stringSets the application name.
shortVersion?stringThe short version, e.g. “1.0”. #### Platform-specific - Windows / Linux: Appended to the end of version in parentheses.
version?stringThe application version.
website?stringThe application website. #### Platform-specific - macOS: Unsupported.
websiteLabel?stringThe website label. #### Platform-specific - macOS: Unsupported.

Options for creating a new check menu item.

PropertyTypeDescriptionInherited fromDefined in
accelerator?stringSpecify an accelerator for the new menu item.MenuItemOptions.accelerator
action?(id: string) => voidSpecify a handler to be called when this menu item is activated.MenuItemOptions.action
checked?booleanWhether the new check menu item is enabled or not.-
enabled?booleanWhether the new menu item is enabled or not.MenuItemOptions.enabled
id?stringSpecify an id to use for the new menu item.MenuItemOptions.id
textstringThe text of the new menu item.MenuItemOptions.text

Options for creating a new icon menu item.

PropertyTypeDescriptionInherited fromDefined in
accelerator?stringSpecify an accelerator for the new menu item.MenuItemOptions.accelerator
action?(id: string) => voidSpecify a handler to be called when this menu item is activated.MenuItemOptions.action
enabled?booleanWhether the new menu item is enabled or not.MenuItemOptions.enabled
icon?| string | number[] | ArrayBuffer | Uint8Array<ArrayBufferLike> | ImageIcon to be used for the new icon menu item.-
id?stringSpecify an id to use for the new menu item.MenuItemOptions.id
textstringThe text of the new menu item.MenuItemOptions.text

Options for creating a new menu item.

PropertyTypeDescriptionDefined in
accelerator?stringSpecify an accelerator for the new menu item.
action?(id: string) => voidSpecify a handler to be called when this menu item is activated.
enabled?booleanWhether the new menu item is enabled or not.
id?stringSpecify an id to use for the new menu item.
textstringThe text of the new menu item.

Options for creating a new menu.

PropertyTypeDescriptionDefined in
id?stringSpecify an id to use for the new menu.
items?( | CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | SubmenuOptions | PredefinedMenuItemOptions | IconMenuItemOptions | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem)[]List of items to add to the new menu.

Options for creating a new predefined menu item.

PropertyTypeDescriptionDefined in
item| object | "Separator" | "Copy" | "Cut" | "Paste" | "SelectAll" | "Undo" | "Redo" | "Minimize" | "Maximize" | "Fullscreen" | "Hide" | "HideOthers" | "ShowAll" | "CloseWindow" | "Quit" | "Services"The predefined item type
text?stringThe text of the new predefined menu item.

type SubmenuOptions: Omit<MenuItemOptions, "accelerator" | "action"> & MenuOptions;