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
Context Menu, like Menu Bar, supports multi-level sub-menus.
123
-
You can use a hierarchical menu to organize a large set of options and group related items.
124
+
Context Menu, like Menu Bar, supports multi-level sub-menus. You can use a hierarchical menu to organize a large set of options and group related items.
Individual menu items can be styled by [since:com.vaadin:[email protected]]#applying custom class names# to them, and writing CSS style blocks targeting those class names.
.Use theme names instead of class names in V24.2 and older
228
+
.Theme Names, Not Class Names
226
229
[NOTE]
227
-
In versions prior to 24.3, theme names must be used instead (`theme` property / `addThemeNames` Java method). The CSS syntax for targeting a theme name is `[theme~="custom-theme"]`
230
+
In versions prior to 24.3, theme names must be used instead (i.e., `theme` property / `addThemeNames` Java method). The CSS syntax for targeting a theme name is `[theme~="custom-theme"]`
To prevent duplicate clicks while the server is processing a request, call the `setDisableOnClick(true)` method on a menu item instance to immediately disable that menu item on the client-side when its clicked.
276
+
To prevent duplicate clicks while the server is processing a request, call the `setDisableOnClick(true)` method on a menu item instance to disable immediately that menu item on the client-side when it's clicked.
272
277
273
278
[.example]
274
279
--
@@ -282,9 +287,10 @@ endif::[]
282
287
283
288
--
284
289
290
+
285
291
== Left-Click
286
292
287
-
You can use left-click to open Context Menu in situations where left-click doesn't have any other function, for example a Grid without selection support.
293
+
You can use left-click to open Context Menu in situations where left-click doesn't have any other function (e.g., a Grid without selection support).
Context Menu allows you to associate custom data with menu items. This can be useful for storing additional information about the item, such as an item type or a value. The data can then be used to trigger actions when an item is selected.
Context Menu is used to provide shortcuts to the user.
324
-
You shouldn't use it as the only or primary means to complete a task.
325
-
The primary way should be accessible elsewhere in the UI.
360
+
Context Menu is used to provide shortcuts to the user. You shouldn't use it as the only or primary means to complete a task. The primary way should be accessible elsewhere in the UI.
326
361
327
362
[IMPORTANT]
328
-
Open the Context Menu by right-clicking (desktop) or long-pressing (mobile) a Grid row, or use the Menu Bar in the last column.
363
+
Open the Context Menu by right-clicking (i.e., for desktops) or long-pressing (i.e., for mobile devices) a Grid row, or use the Menu Bar in the last column.
You should use Context Menu when there is no dedicated button for opening an overlay menu, such as right-clicking a grid row.
362
-
When there is a dedicated element/component, such as an <<../menu-bar#,overflow menu>>, use Menu Bar.
395
+
=== Context Menu vs. Menu Bar
396
+
397
+
You should use Context Menu when there is no dedicated button for opening an overlay menu, such as right-clicking a grid row. When there is a dedicated element or component, such as an <<../menu-bar#,overflow menu>>, use Menu Bar.
398
+
363
399
364
400
=== Icons
365
401
366
-
Use icons when applicable to help improve recognition.
367
-
It's recommended to use commonly recognized icons to avoid confusion.
368
-
Use icons consistently throughout a list of options.
402
+
Use icons when applicable to help improve recognition. It's recommended to use commonly recognized icons to avoid confusion. Use icons consistently throughout a list of options.
403
+
369
404
370
405
=== Labelling
371
406
372
-
Suffix a menu item with “...” when the associated action won't be executed, but instead reveal some UI, like a dialog, for completing the action.
407
+
Suffix a menu item with "..." when the associated action won't be executed, but instead reveal some UI, like a dialog, for completing the action.
373
408
374
409
375
410
== Related Components
376
411
377
412
|===
378
-
|Component |Usage recommendations
413
+
|Component |Usage Recommendations
379
414
380
415
|<<../menu-bar#,Menu Bar>>
381
416
|Component for displaying a horizontal menu with multi-level sub-menus.
Menu Bar allows you to associate custom data with menu items. This can be useful for storing additional information about the item, such as an item type or a value. The data can then be used to trigger actions when an item is selected.
0 commit comments