You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/learn/system-tray.mdx
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -308,6 +308,8 @@ See [`TrayIconEvent`][rust TrayIconEvent] for more information on the event type
308
308
</TabItem>
309
309
</Tabs>
310
310
311
+
For detailed information about creating menus, including menu items, submenus, and dynamic updates, see the [Window Menu](/learn/window-menu/) documentation.
Copy file name to clipboardExpand all lines: src/content/docs/learn/window-menu.mdx
+67-10Lines changed: 67 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Native application menus can be attached to both to a window or system tray. Ava
11
11
12
12
## Creating a base-level menu
13
13
14
-
To create a base-level native window menu, and attach to a window:
14
+
To create a base-level native window menu, and attach to a window. You can create various types of menu items including basic items, check items, and separators:
15
15
16
16
<Tabs>
17
17
<TabItemlabel="JavaScript">
@@ -30,13 +30,36 @@ const menu = await Menu.new({
30
30
console.log('quit pressed');
31
31
},
32
32
},
33
+
{
34
+
id:'check_item',
35
+
text:'Check Item',
36
+
checked:true,
37
+
},
38
+
{
39
+
type:'Separator',
40
+
},
41
+
{
42
+
id:'disabled_item',
43
+
text:'Disabled Item',
44
+
enabled:false,
45
+
},
46
+
{
47
+
id:'status',
48
+
text:'Status: Processing...',
49
+
},
33
50
],
34
51
});
35
52
36
53
// If a window was not created with an explicit menu or had one set explicitly,
@@ -147,6 +181,10 @@ Multi-level menus allow you to group menu items under categories like "File," "E
147
181
148
182
**Note:** When using submenus on MacOS, all items must be grouped under a submenu. Top-level items will be ignored. Additionally, the first submenu will be placed under the application's about menu by default, regardless of the `text` label. You should include a submenu as the first entry (say, an "About" submenu) to fill this space.
149
183
184
+
:::note
185
+
Icon support for submenus is available since Tauri 2.8.0.
0 commit comments