Skip to content

menu

Enumerations

NativeIcon

A native Icon to be used for the menu item

Platform-specific:

  • Windows / Linux: Unsupported.

Enumeration Members

Add
Add: "Add";

An add item template image.

Advanced
Advanced: "Advanced";

Advanced preferences toolbar icon for the preferences window.

Bluetooth
Bluetooth: "Bluetooth";

A Bluetooth template image.

Bookmarks
Bookmarks: "Bookmarks";

Bookmarks image suitable for a template.

Caution
Caution: "Caution";

A caution image.

ColorPanel
ColorPanel: "ColorPanel";

A color panel toolbar icon.

ColumnView
ColumnView: "ColumnView";

A column view mode template image.

Computer
Computer: "Computer";

A computer icon.

EnterFullScreen
EnterFullScreen: "EnterFullScreen";

An enter full-screen mode template image.

Everyone
Everyone: "Everyone";

Permissions for all users.

ExitFullScreen
ExitFullScreen: "ExitFullScreen";

An exit full-screen mode template image.

FlowView
FlowView: "FlowView";

A cover flow view mode template image.

Folder
Folder: "Folder";

A folder image.

FolderBurnable
FolderBurnable: "FolderBurnable";

A burnable folder icon.

FolderSmart
FolderSmart: "FolderSmart";

A smart folder icon.

FollowLinkFreestanding
FollowLinkFreestanding: "FollowLinkFreestanding";

A link template image.

FontPanel
FontPanel: "FontPanel";

A font panel toolbar icon.

GoLeft
GoLeft: "GoLeft";

A go back template image.

GoRight
GoRight: "GoRight";

A go forward template image.

Home
Home: "Home";

Home image suitable for a template.

IChatTheater
IChatTheater: "IChatTheater";

An iChat Theater template image.

IconView
IconView: "IconView";

An icon view mode template image.

Info
Info: "Info";

An information toolbar icon.

InvalidDataFreestanding
InvalidDataFreestanding: "InvalidDataFreestanding";

A template image used to denote invalid data.

LeftFacingTriangle
LeftFacingTriangle: "LeftFacingTriangle";

A generic left-facing triangle template image.

ListView
ListView: "ListView";

A list view mode template image.

LockLocked
LockLocked: "LockLocked";

A locked padlock template image.

LockUnlocked
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: "MobileMe";

A MobileMe icon.

MultipleDocuments
MultipleDocuments: "MultipleDocuments";

A drag image for multiple items.

Network
Network: "Network";

A network icon.

Path
Path: "Path";

A path button template image.

PreferencesGeneral
PreferencesGeneral: "PreferencesGeneral";

General preferences toolbar icon for the preferences window.

QuickLook
QuickLook: "QuickLook";

A Quick Look template image.

Refresh
Refresh: "Refresh";

A refresh template image.

RefreshFreestanding
RefreshFreestanding: "RefreshFreestanding";

A refresh template image.

Remove
Remove: "Remove";

A remove item template image.

RevealFreestanding
RevealFreestanding: "RevealFreestanding";

A reveal contents template image.

RightFacingTriangle
RightFacingTriangle: "RightFacingTriangle";

A generic right-facing triangle template image.

Share
Share: "Share";

A share view template image.

Slideshow
Slideshow: "Slideshow";

A slideshow template image.

SmartBadge
SmartBadge: "SmartBadge";

A badge for a smart item.

StatusAvailable
StatusAvailable: "StatusAvailable";

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

StatusNone
StatusNone: "StatusNone";

Small clear indicator.

StatusPartiallyAvailable
StatusPartiallyAvailable: "StatusPartiallyAvailable";

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

StatusUnavailable
StatusUnavailable: "StatusUnavailable";

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

StopProgress
StopProgress: "StopProgress";

A stop progress button template image.

StopProgressFreestanding
StopProgressFreestanding: "StopProgressFreestanding";

A stop progress template image.

TrashEmpty
TrashEmpty: "TrashEmpty";

An image of the empty trash can.

TrashFull
TrashFull: "TrashFull";

An image of the full trash can.

User
User: "User";

Permissions for a single user.

UserAccounts
UserAccounts: "UserAccounts";

User account toolbar icon for the preferences window.

UserGroup
UserGroup: "UserGroup";

Permissions for a group of users.

UserGuest
UserGuest: "UserGuest";

Permissions for guests.

Classes

CheckMenuItem

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.

Extends

  • MenuItemBase

Accessors

id
Get Signature
get id(): string

The id of this item.

Returns

string

Inherited from

MenuItemBase.id

rid
Get Signature
get rid(): number
Returns

number

Inherited from

MenuItemBase.rid

Methods

close()
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.

Returns

Promise<void>

Inherited from

MenuItemBase.close

isChecked()
isChecked(): Promise<boolean>

Returns whether this check menu item is checked or not.

Returns

Promise<boolean>

isEnabled()
isEnabled(): Promise<boolean>

Returns whether this check menu item is enabled or not.

Returns

Promise<boolean>

setAccelerator()
setAccelerator(accelerator): Promise<void>

Sets the accelerator for this check menu item.

Parameters
ParameterType
acceleratornull | string
Returns

Promise<void>

setChecked()
setChecked(checked): Promise<void>

Sets whether this check menu item is checked or not.

Parameters
ParameterType
checkedboolean
Returns

Promise<void>

setEnabled()
setEnabled(enabled): Promise<void>

Sets whether this check menu item is enabled or not.

Parameters
ParameterType
enabledboolean
Returns

Promise<void>

setText()
setText(text): Promise<void>

Sets the text for this check menu item.

Parameters
ParameterType
textstring
Returns

Promise<void>

text()
text(): Promise<string>

Returns the text of this check menu item.

Returns

Promise<string>

new()
static new(opts): Promise<CheckMenuItem>

Create a new check menu item.

Parameters
ParameterType
optsCheckMenuItemOptions
Returns

Promise<CheckMenuItem>


IconMenuItem

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

Extends

  • MenuItemBase

Accessors

id
Get Signature
get id(): string

The id of this item.

Returns

string

Inherited from

MenuItemBase.id

rid
Get Signature
get rid(): number
Returns

number

Inherited from

MenuItemBase.rid

Methods

close()
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.

Returns

Promise<void>

Inherited from

MenuItemBase.close

isEnabled()
isEnabled(): Promise<boolean>

Returns whether this icon menu item is enabled or not.

Returns

Promise<boolean>

setAccelerator()
setAccelerator(accelerator): Promise<void>

Sets the accelerator for this icon menu item.

Parameters
ParameterType
acceleratornull | string
Returns

Promise<void>

setEnabled()
setEnabled(enabled): Promise<void>

Sets whether this icon menu item is enabled or not.

Parameters
ParameterType
enabledboolean
Returns

Promise<void>

setIcon()
setIcon(icon): Promise<void>

Sets an icon for this icon menu item

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

Promise<void>

setText()
setText(text): Promise<void>

Sets the text for this icon menu item.

Parameters
ParameterType
textstring
Returns

Promise<void>

text()
text(): Promise<string>

Returns the text of this icon menu item.

Returns

Promise<string>

new()
static new(opts): Promise<IconMenuItem>

Create a new icon menu item.

Parameters
ParameterType
optsIconMenuItemOptions
Returns

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.

Platform-specific:

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

Extends

  • MenuItemBase

Accessors

id
Get Signature
get id(): string

The id of this item.

Returns

string

Inherited from

MenuItemBase.id

rid
Get Signature
get rid(): number
Returns

number

Inherited from

MenuItemBase.rid

Methods

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

Add a menu item to the end of this menu.

Platform-specific:

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

Promise<void>

close()
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.

Returns

Promise<void>

Inherited from

MenuItemBase.close

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

Retrieves the menu item matching the given identifier.

Parameters
ParameterType
idstring
Returns

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

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

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

Platform-specific:

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

Promise<void>

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

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

Returns

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

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

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

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

Parameters
ParameterType
at?LogicalPosition | PhysicalPosition | Position
window?Window
Returns

Promise<void>

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

Add a menu item to the beginning of this menu.

Platform-specific:

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

Promise<void>

remove()
remove(item): Promise<void>

Remove a menu item from this menu.

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

Promise<void>

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

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

Parameters
ParameterType
positionnumber
Returns

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

setAsAppMenu()
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.

Returns

Promise<null | Menu>

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

Sets the window menu and returns the previous one.

Platform-specific:

  • 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.
Parameters
ParameterType
window?Window
Returns

Promise<null | Menu>

default()
static default(): Promise<Menu>

Create a default menu.

Returns

Promise<Menu>

new()
static new(opts?): Promise<Menu>

Create a new menu.

Parameters
ParameterType
opts?MenuOptions
Returns

Promise<Menu>


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

Extends

  • MenuItemBase

Accessors

id
Get Signature
get id(): string

The id of this item.

Returns

string

Inherited from

MenuItemBase.id

rid
Get Signature
get rid(): number
Returns

number

Inherited from

MenuItemBase.rid

Methods

close()
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.

Returns

Promise<void>

Inherited from

MenuItemBase.close

isEnabled()
isEnabled(): Promise<boolean>

Returns whether this menu item is enabled or not.

Returns

Promise<boolean>

setAccelerator()
setAccelerator(accelerator): Promise<void>

Sets the accelerator for this menu item.

Parameters
ParameterType
acceleratornull | string
Returns

Promise<void>

setEnabled()
setEnabled(enabled): Promise<void>

Sets whether this menu item is enabled or not.

Parameters
ParameterType
enabledboolean
Returns

Promise<void>

setText()
setText(text): Promise<void>

Sets the text for this menu item.

Parameters
ParameterType
textstring
Returns

Promise<void>

text()
text(): Promise<string>

Returns the text of this menu item.

Returns

Promise<string>

new()
static new(opts): Promise<MenuItem>

Create a new menu item.

Parameters
ParameterType
optsMenuItemOptions
Returns

Promise<MenuItem>


PredefinedMenuItem

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

Extends

  • MenuItemBase

Accessors

id
Get Signature
get id(): string

The id of this item.

Returns

string

Inherited from

MenuItemBase.id

rid
Get Signature
get rid(): number
Returns

number

Inherited from

MenuItemBase.rid

Methods

close()
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.

Returns

Promise<void>

Inherited from

MenuItemBase.close

setText()
setText(text): Promise<void>

Sets the text for this predefined menu item.

Parameters
ParameterType
textstring
Returns

Promise<void>

text()
text(): Promise<string>

Returns the text of this predefined menu item.

Returns

Promise<string>

new()
static new(opts?): Promise<PredefinedMenuItem>

Create a new predefined menu item.

Parameters
ParameterType
opts?PredefinedMenuItemOptions
Returns

Promise<PredefinedMenuItem>


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

Extends

  • MenuItemBase

Accessors

id
Get Signature
get id(): string

The id of this item.

Returns

string

Inherited from

MenuItemBase.id

rid
Get Signature
get rid(): number
Returns

number

Inherited from

MenuItemBase.rid

Methods

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

Add a menu item to the end of this submenu.

Platform-specific:

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

Promise<void>

close()
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.

Returns

Promise<void>

Inherited from

MenuItemBase.close

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

Retrieves the menu item matching the given identifier.

Parameters
ParameterType
idstring
Returns

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

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

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

Platform-specific:

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

Promise<void>

isEnabled()
isEnabled(): Promise<boolean>

Returns whether this submenu is enabled or not.

Returns

Promise<boolean>

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

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

Returns

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.

Parameters
ParameterType
at?LogicalPosition | PhysicalPosition
window?Window
Returns

Promise<void>

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

Add a menu item to the beginning of this submenu.

Platform-specific:

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

Promise<void>

remove()
remove(item): Promise<void>

Remove a menu item from this submenu.

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

Promise<void>

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

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

Parameters
ParameterType
positionnumber
Returns

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

setAsHelpMenuForNSApp()
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”.

Platform-specific:

  • Windows / Linux: Unsupported.
Returns

Promise<void>

setAsWindowsMenuForNSApp()
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.

Platform-specific:

  • Windows / Linux: Unsupported.
Returns

Promise<void>

setEnabled()
setEnabled(enabled): Promise<void>

Sets whether this submenu is enabled or not.

Parameters
ParameterType
enabledboolean
Returns

Promise<void>

setText()
setText(text): Promise<void>

Sets the text for this submenu.

Parameters
ParameterType
textstring
Returns

Promise<void>

text()
text(): Promise<string>

Returns the text of this submenu.

Returns

Promise<string>

new()
static new(opts): Promise<Submenu>

Create a new submenu.

Parameters
ParameterType
optsSubmenuOptions
Returns

Promise<Submenu>

Interfaces

AboutMetadata

A metadata for the about predefined menu item.

Properties

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.

CheckMenuItemOptions

Options for creating a new check menu item.

Extends

Properties

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

IconMenuItemOptions

Options for creating a new icon menu item.

Extends

Properties

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.

Extended by

Properties

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.

Properties

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.

PredefinedMenuItemOptions

Options for creating a new predefined menu item.

Properties

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 Aliases

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