menu
이 콘텐츠는 아직 번역되지 않았습니다.
Enumerations
Section titled “Enumerations”NativeIcon
Section titled “NativeIcon”A native Icon to be used for the menu item
Platform-specific:
- Windows / Linux: Unsupported.
Enumeration Members
Section titled “Enumeration Members”Add: "Add";An add item template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L19
Advanced
Section titled “Advanced”Advanced: "Advanced";Advanced preferences toolbar icon for the preferences window.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L21
Bluetooth
Section titled “Bluetooth”Bluetooth: "Bluetooth";A Bluetooth template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L23
Bookmarks
Section titled “Bookmarks”Bookmarks: "Bookmarks";Bookmarks image suitable for a template.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L25
Caution
Section titled “Caution”Caution: "Caution";A caution image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L27
ColorPanel
Section titled “ColorPanel”ColorPanel: "ColorPanel";A color panel toolbar icon.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L29
ColumnView
Section titled “ColumnView”ColumnView: "ColumnView";A column view mode template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L31
Computer
Section titled “Computer”Computer: "Computer";A computer icon.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L33
EnterFullScreen
Section titled “EnterFullScreen”EnterFullScreen: "EnterFullScreen";An enter full-screen mode template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L35
Everyone
Section titled “Everyone”Everyone: "Everyone";Permissions for all users.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L37
ExitFullScreen
Section titled “ExitFullScreen”ExitFullScreen: "ExitFullScreen";An exit full-screen mode template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L39
FlowView
Section titled “FlowView”FlowView: "FlowView";A cover flow view mode template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L41
Folder
Section titled “Folder”Folder: "Folder";A folder image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L43
FolderBurnable
Section titled “FolderBurnable”FolderBurnable: "FolderBurnable";A burnable folder icon.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L45
FolderSmart
Section titled “FolderSmart”FolderSmart: "FolderSmart";A smart folder icon.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L47
FollowLinkFreestanding
Section titled “FollowLinkFreestanding”FollowLinkFreestanding: "FollowLinkFreestanding";A link template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L49
FontPanel
Section titled “FontPanel”FontPanel: "FontPanel";A font panel toolbar icon.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L51
GoLeft
Section titled “GoLeft”GoLeft: "GoLeft";A go back template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L53
GoRight
Section titled “GoRight”GoRight: "GoRight";A go forward template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L55
Home: "Home";Home image suitable for a template.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L57
IChatTheater
Section titled “IChatTheater”IChatTheater: "IChatTheater";An iChat Theater template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L59
IconView
Section titled “IconView”IconView: "IconView";An icon view mode template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L61
Info: "Info";An information toolbar icon.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L63
InvalidDataFreestanding
Section titled “InvalidDataFreestanding”InvalidDataFreestanding: "InvalidDataFreestanding";A template image used to denote invalid data.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L65
LeftFacingTriangle
Section titled “LeftFacingTriangle”LeftFacingTriangle: "LeftFacingTriangle";A generic left-facing triangle template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L67
ListView
Section titled “ListView”ListView: "ListView";A list view mode template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L69
LockLocked
Section titled “LockLocked”LockLocked: "LockLocked";A locked padlock template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L71
LockUnlocked
Section titled “LockUnlocked”LockUnlocked: "LockUnlocked";An unlocked padlock template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L73
MenuMixedState
Section titled “MenuMixedState”MenuMixedState: "MenuMixedState";A horizontal dash, for use in menus.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L75
MenuOnState
Section titled “MenuOnState”MenuOnState: "MenuOnState";A check mark template image, for use in menus.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L77
MobileMe
Section titled “MobileMe”MobileMe: "MobileMe";A MobileMe icon.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L79
MultipleDocuments
Section titled “MultipleDocuments”MultipleDocuments: "MultipleDocuments";A drag image for multiple items.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L81
Network
Section titled “Network”Network: "Network";A network icon.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L83
Path: "Path";A path button template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L85
PreferencesGeneral
Section titled “PreferencesGeneral”PreferencesGeneral: "PreferencesGeneral";General preferences toolbar icon for the preferences window.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L87
QuickLook
Section titled “QuickLook”QuickLook: "QuickLook";A Quick Look template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L89
Refresh
Section titled “Refresh”Refresh: "Refresh";A refresh template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L93
RefreshFreestanding
Section titled “RefreshFreestanding”RefreshFreestanding: "RefreshFreestanding";A refresh template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L91
Remove
Section titled “Remove”Remove: "Remove";A remove item template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L95
RevealFreestanding
Section titled “RevealFreestanding”RevealFreestanding: "RevealFreestanding";A reveal contents template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L97
RightFacingTriangle
Section titled “RightFacingTriangle”RightFacingTriangle: "RightFacingTriangle";A generic right-facing triangle template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L99
Share: "Share";A share view template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L101
Slideshow
Section titled “Slideshow”Slideshow: "Slideshow";A slideshow template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L103
SmartBadge
Section titled “SmartBadge”SmartBadge: "SmartBadge";A badge for a smart item.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L105
StatusAvailable
Section titled “StatusAvailable”StatusAvailable: "StatusAvailable";Small green indicator, similar to iChat’s available image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L107
StatusNone
Section titled “StatusNone”StatusNone: "StatusNone";Small clear indicator.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L109
StatusPartiallyAvailable
Section titled “StatusPartiallyAvailable”StatusPartiallyAvailable: "StatusPartiallyAvailable";Small yellow indicator, similar to iChat’s idle image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L111
StatusUnavailable
Section titled “StatusUnavailable”StatusUnavailable: "StatusUnavailable";Small red indicator, similar to iChat’s unavailable image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L113
StopProgress
Section titled “StopProgress”StopProgress: "StopProgress";A stop progress button template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L117
StopProgressFreestanding
Section titled “StopProgressFreestanding”StopProgressFreestanding: "StopProgressFreestanding";A stop progress template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L115
TrashEmpty
Section titled “TrashEmpty”TrashEmpty: "TrashEmpty";An image of the empty trash can.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L119
TrashFull
Section titled “TrashFull”TrashFull: "TrashFull";An image of the full trash can.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L121
User: "User";Permissions for a single user.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L123
UserAccounts
Section titled “UserAccounts”UserAccounts: "UserAccounts";User account toolbar icon for the preferences window.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L125
UserGroup
Section titled “UserGroup”UserGroup: "UserGroup";Permissions for a group of users.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L127
UserGuest
Section titled “UserGuest”UserGuest: "UserGuest";Permissions for guests.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L129
Classes
Section titled “Classes”CheckMenuItem
Section titled “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
Section titled “Extends”MenuItemBase
Accessors
Section titled “Accessors”get id(): stringThe id of this item.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”MenuItemBase.id
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/base.ts#L128
get rid(): numberReturns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”MenuItemBase.rid
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L318
Methods
Section titled “Methods”close()
Section titled “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
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”MenuItemBase.close
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L330
isChecked()
Section titled “isChecked()”isChecked(): Promise<boolean>Returns whether this check menu item is checked or not.
Returns
Section titled “Returns”Promise<boolean>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/checkMenuItem.ts#L71
isEnabled()
Section titled “isEnabled()”isEnabled(): Promise<boolean>Returns whether this check menu item is enabled or not.
Returns
Section titled “Returns”Promise<boolean>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/checkMenuItem.ts#L48
setAccelerator()
Section titled “setAccelerator()”setAccelerator(accelerator): Promise<void>Sets the accelerator for this check menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
accelerator | null | string |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/checkMenuItem.ts#L62
setChecked()
Section titled “setChecked()”setChecked(checked): Promise<void>Sets whether this check menu item is checked or not.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
checked | boolean |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/checkMenuItem.ts#L76
setEnabled()
Section titled “setEnabled()”setEnabled(enabled): Promise<void>Sets whether this check menu item is enabled or not.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
enabled | boolean |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/checkMenuItem.ts#L53
setText()
Section titled “setText()”setText(text): Promise<void>Sets the text for this check menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text | string |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/checkMenuItem.ts#L39
text()
Section titled “text()”text(): Promise<string>Returns the text of this check menu item.
Returns
Section titled “Returns”Promise<string>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/checkMenuItem.ts#L34
static new(opts): Promise<CheckMenuItem>Create a new check menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts | CheckMenuItemOptions |
Returns
Section titled “Returns”Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/checkMenuItem.ts#L27
IconMenuItem
Section titled “IconMenuItem”An icon menu item inside a Menu or Submenu
and usually contains an icon and a text.
Extends
Section titled “Extends”MenuItemBase
Accessors
Section titled “Accessors”get id(): stringThe id of this item.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”MenuItemBase.id
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/base.ts#L128
get rid(): numberReturns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”MenuItemBase.rid
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L318
Methods
Section titled “Methods”close()
Section titled “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
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”MenuItemBase.close
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L330
isEnabled()
Section titled “isEnabled()”isEnabled(): Promise<boolean>Returns whether this icon menu item is enabled or not.
Returns
Section titled “Returns”Promise<boolean>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L177
setAccelerator()
Section titled “setAccelerator()”setAccelerator(accelerator): Promise<void>Sets the accelerator for this icon menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
accelerator | null | string |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L191
setEnabled()
Section titled “setEnabled()”setEnabled(enabled): Promise<void>Sets whether this icon menu item is enabled or not.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
enabled | boolean |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L182
setIcon()
Section titled “setIcon()”setIcon(icon): Promise<void>Sets an icon for this icon menu item
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
icon | null | MenuIcon |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L200
setText()
Section titled “setText()”setText(text): Promise<void>Sets the text for this icon menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text | string |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L168
text()
Section titled “text()”text(): Promise<string>Returns the text of this icon menu item.
Returns
Section titled “Returns”Promise<string>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L163
static new(opts): Promise<IconMenuItem>Create a new icon menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts | IconMenuItemOptions |
Returns
Section titled “Returns”Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L158
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:
Extends
Section titled “Extends”MenuItemBase
Accessors
Section titled “Accessors”get id(): stringThe id of this item.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”MenuItemBase.id
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/base.ts#L128
get rid(): numberReturns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”MenuItemBase.rid
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L318
Methods
Section titled “Methods”append()
Section titled “append()”append<T>(items): Promise<void>Add a menu item to the end of this menu.
Platform-specific:
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends | MenuItemOptions | MenuItem | SubmenuOptions | PredefinedMenuItemOptions | CheckMenuItemOptions | IconMenuItemOptions | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
items | T | T[] |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L73
close()
Section titled “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
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”MenuItemBase.close
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L330
get(id): Promise< | null | MenuItem | PredefinedMenuItem | Submenu | CheckMenuItem| IconMenuItem>Retrieves the menu item matching the given identifier.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id | string |
Returns
Section titled “Returns”Promise<
| null
| MenuItem
| PredefinedMenuItem
| Submenu
| CheckMenuItem
| IconMenuItem>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L196
insert()
Section titled “insert()”insert<T>(items, position): Promise<void>Add a menu item to the specified position in this menu.
Platform-specific:
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends | MenuItemOptions | MenuItem | SubmenuOptions | PredefinedMenuItemOptions | CheckMenuItemOptions | IconMenuItemOptions | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
items | T | T[] |
position | number |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L131
items()
Section titled “items()”items(): Promise<( | MenuItem | PredefinedMenuItem | Submenu | CheckMenuItem| IconMenuItem)[]>Returns a list of menu items that has been added to this menu.
Returns
Section titled “Returns”Promise<(
| MenuItem
| PredefinedMenuItem
| Submenu
| CheckMenuItem
| IconMenuItem)[]>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L184
popup()
Section titled “popup()”popup(at?, window?): Promise<void>Popup this menu as a context menu on the specified window.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
at? | LogicalPosition | PhysicalPosition | Position | If 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 | - |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L219
prepend()
Section titled “prepend()”prepend<T>(items): Promise<void>Add a menu item to the beginning of this menu.
Platform-specific:
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends | MenuItemOptions | MenuItem | SubmenuOptions | PredefinedMenuItemOptions | CheckMenuItemOptions | IconMenuItemOptions | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
items | T | T[] |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L102
remove()
Section titled “remove()”remove(item): Promise<void>Remove a menu item from this menu.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
item | | MenuItem | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L155
removeAt()
Section titled “removeAt()”removeAt(position): Promise< | null | MenuItem | PredefinedMenuItem | Submenu | CheckMenuItem| IconMenuItem>Remove a menu item from this menu at the specified position.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
position | number |
Returns
Section titled “Returns”Promise<
| null
| MenuItem
| PredefinedMenuItem
| Submenu
| CheckMenuItem
| IconMenuItem>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L166
setAsAppMenu()
Section titled “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
Section titled “Returns”Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L237
setAsWindowMenu()
Section titled “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.setAsAppMenuinstead.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
window? | Window |
Returns
Section titled “Returns”Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L251
default()
Section titled “default()”static default(): Promise<Menu>Create a default menu.
Returns
Section titled “Returns”Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L60
static new(opts?): Promise<Menu>Create a new menu.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts? | MenuOptions |
Returns
Section titled “Returns”Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L55
MenuItem
Section titled “MenuItem”A menu item inside a Menu or Submenu and contains only text.
Extends
Section titled “Extends”MenuItemBase
Accessors
Section titled “Accessors”get id(): stringThe id of this item.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”MenuItemBase.id
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/base.ts#L128
get rid(): numberReturns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”MenuItemBase.rid
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L318
Methods
Section titled “Methods”close()
Section titled “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
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”MenuItemBase.close
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L330
isEnabled()
Section titled “isEnabled()”isEnabled(): Promise<boolean>Returns whether this menu item is enabled or not.
Returns
Section titled “Returns”Promise<boolean>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L49
setAccelerator()
Section titled “setAccelerator()”setAccelerator(accelerator): Promise<void>Sets the accelerator for this menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
accelerator | null | string |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L63
setEnabled()
Section titled “setEnabled()”setEnabled(enabled): Promise<void>Sets whether this menu item is enabled or not.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
enabled | boolean |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L54
setText()
Section titled “setText()”setText(text): Promise<void>Sets the text for this menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text | string |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L40
text()
Section titled “text()”text(): Promise<string>Returns the text of this menu item.
Returns
Section titled “Returns”Promise<string>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L35
static new(opts): Promise<MenuItem>Create a new menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts | MenuItemOptions |
Returns
Section titled “Returns”Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L30
PredefinedMenuItem
Section titled “PredefinedMenuItem”A predefined (native) menu item which has a predefined behavior by the OS or by tauri.
Extends
Section titled “Extends”MenuItemBase
Accessors
Section titled “Accessors”get id(): stringThe id of this item.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”MenuItemBase.id
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/base.ts#L128
get rid(): numberReturns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”MenuItemBase.rid
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L318
Methods
Section titled “Methods”close()
Section titled “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
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”MenuItemBase.close
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L330
setText()
Section titled “setText()”setText(text): Promise<void>Sets the text for this predefined menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text | string |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/predefinedMenuItem.ts#L133
text()
Section titled “text()”text(): Promise<string>Returns the text of this predefined menu item.
Returns
Section titled “Returns”Promise<string>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/predefinedMenuItem.ts#L128
static new(opts?): Promise<PredefinedMenuItem>Create a new predefined menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts? | PredefinedMenuItemOptions |
Returns
Section titled “Returns”Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/predefinedMenuItem.ts#L119
Submenu
Section titled “Submenu”A type that is a submenu inside a Menu or Submenu.
Extends
Section titled “Extends”MenuItemBase
Accessors
Section titled “Accessors”get id(): stringThe id of this item.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”MenuItemBase.id
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/base.ts#L128
get rid(): numberReturns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”MenuItemBase.rid
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L318
Methods
Section titled “Methods”append()
Section titled “append()”append<T>(items): Promise<void>Add a menu item to the end of this submenu.
Platform-specific:
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends | MenuItemOptions | MenuItem | SubmenuOptions | PredefinedMenuItemOptions | CheckMenuItemOptions | IconMenuItemOptions | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
items | T | T[] |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L106
close()
Section titled “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
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”MenuItemBase.close
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L330
get(id): Promise< | null | MenuItem | PredefinedMenuItem | Submenu | CheckMenuItem| IconMenuItem>Retrieves the menu item matching the given identifier.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id | string |
Returns
Section titled “Returns”Promise<
| null
| MenuItem
| PredefinedMenuItem
| Submenu
| CheckMenuItem
| IconMenuItem>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L229
insert()
Section titled “insert()”insert<T>(items, position): Promise<void>Add a menu item to the specified position in this submenu.
Platform-specific:
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends | MenuItemOptions | MenuItem | SubmenuOptions | PredefinedMenuItemOptions | CheckMenuItemOptions | IconMenuItemOptions | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
items | T | T[] |
position | number |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L164
isEnabled()
Section titled “isEnabled()”isEnabled(): Promise<boolean>Returns whether this submenu is enabled or not.
Returns
Section titled “Returns”Promise<boolean>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L86
items()
Section titled “items()”items(): Promise<( | MenuItem | PredefinedMenuItem | Submenu | CheckMenuItem| IconMenuItem)[]>Returns a list of menu items that has been added to this submenu.
Returns
Section titled “Returns”Promise<(
| MenuItem
| PredefinedMenuItem
| Submenu
| CheckMenuItem
| IconMenuItem)[]>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L217
popup()
Section titled “popup()”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
Section titled “Parameters”| Parameter | Type |
|---|---|
at? | LogicalPosition | PhysicalPosition |
window? | Window |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L251
prepend()
Section titled “prepend()”prepend<T>(items): Promise<void>Add a menu item to the beginning of this submenu.
Platform-specific:
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends | MenuItemOptions | MenuItem | SubmenuOptions | PredefinedMenuItemOptions | CheckMenuItemOptions | IconMenuItemOptions | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
items | T | T[] |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L135
remove()
Section titled “remove()”remove(item): Promise<void>Remove a menu item from this submenu.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
item | | MenuItem | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L188
removeAt()
Section titled “removeAt()”removeAt(position): Promise< | null | MenuItem | PredefinedMenuItem | Submenu | CheckMenuItem| IconMenuItem>Remove a menu item from this submenu at the specified position.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
position | number |
Returns
Section titled “Returns”Promise<
| null
| MenuItem
| PredefinedMenuItem
| Submenu
| CheckMenuItem
| IconMenuItem>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L199
setAsHelpMenuForNSApp()
Section titled “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
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L291
setAsWindowsMenuForNSApp()
Section titled “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
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L273
setEnabled()
Section titled “setEnabled()”setEnabled(enabled): Promise<void>Sets whether this submenu is enabled or not.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
enabled | boolean |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L91
setIcon()
Section titled “setIcon()”setIcon(icon): Promise<void>Sets an icon for this submenu
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
icon | null | MenuIcon |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L298
setText()
Section titled “setText()”setText(text): Promise<void>Sets the text for this submenu.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text | string |
Returns
Section titled “Returns”Promise<void>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L77
text()
Section titled “text()”text(): Promise<string>Returns the text of this submenu.
Returns
Section titled “Returns”Promise<string>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L72
static new(opts): Promise<Submenu>Create a new submenu.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts | SubmenuOptions |
Returns
Section titled “Returns”Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L67
Interfaces
Section titled “Interfaces”AboutMetadata
Section titled “AboutMetadata”A metadata for the about predefined menu item.
Properties
Section titled “Properties”CheckMenuItemOptions
Section titled “CheckMenuItemOptions”Options for creating a new check menu item.
Extends
Section titled “Extends”Properties
Section titled “Properties”IconMenuItemOptions
Section titled “IconMenuItemOptions”Options for creating a new icon menu item.
Extends
Section titled “Extends”Properties
Section titled “Properties”| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
accelerator? | string | Specify an accelerator for the new menu item. | MenuItemOptions.accelerator | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L17 |
action? | (id: string) => void | Specify a handler to be called when this menu item is activated. | MenuItemOptions.action | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L19 |
enabled? | boolean | Whether the new menu item is enabled or not. | MenuItemOptions.enabled | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L15 |
icon? | MenuIcon | Icon to be used for the new icon menu item. Note that you may need the image-ico or image-png Cargo features to use this API. To enable it, change your Cargo.toml file: [dependencies] tauri = { version = "...", features = ["...", "image-png"] } | - | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L144 |
id? | string | Specify an id to use for the new menu item. | MenuItemOptions.id | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L11 |
text | string | The text of the new menu item. | MenuItemOptions.text | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L13 |
MenuItemOptions
Section titled “MenuItemOptions”Options for creating a new menu item.
Extended by
Section titled “Extended by”Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
accelerator? | string | Specify an accelerator for the new menu item. | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L17 |
action? | (id: string) => void | Specify a handler to be called when this menu item is activated. | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L19 |
enabled? | boolean | Whether the new menu item is enabled or not. | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L15 |
id? | string | Specify an id to use for the new menu item. | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L11 |
text | string | The text of the new menu item. | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L13 |
MenuOptions
Section titled “MenuOptions”Options for creating a new menu.
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
id? | string | Specify an id to use for the new menu. | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L25 |
items? | ( | MenuItemOptions | MenuItem | SubmenuOptions | PredefinedMenuItemOptions | CheckMenuItemOptions | IconMenuItemOptions | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem)[] | List of items to add to the new menu. | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L27 |
PredefinedMenuItemOptions
Section titled “PredefinedMenuItemOptions”Options for creating a new predefined menu item.
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
item | | object | "Separator" | "Copy" | "Cut" | "Paste" | "SelectAll" | "Undo" | "Redo" | "Minimize" | "Maximize" | "Fullscreen" | "Hide" | "HideOthers" | "ShowAll" | "CloseWindow" | "Quit" | "Services" | "BringAllToFront" | The predefined item type | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/predefinedMenuItem.ts#L88 |
text? | string | The text of the new predefined menu item. | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/predefinedMenuItem.ts#L86 |
Type Aliases
Section titled “Type Aliases”SubmenuOptions
Section titled “SubmenuOptions”type SubmenuOptions: Omit<MenuItemOptions, "accelerator" | "action"> & MenuOptions & object;Type declaration
Section titled “Type declaration”| Name | Type | Description | Defined in |
|---|---|---|---|
icon | MenuIcon | Icon to be used for the submenu. Note: you may need the image-ico or image-png Cargo features to use this API. | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L56 |
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L50
© 2026 Tauri Contributors. CC-BY / MIT