Context Menu
- Dividers
- Checkable Menu Items
- Hierarchical Menu
- Custom Items
- Disabled Menu Items
- Left-Click
- Best Practices
- Related Components
Context Menu is a component that you can attach to any component to display a context menu. The menu appears on right (default) or left click. On a touch device, a long press opens the context menu.
Important
| Open the Context Menu by right-clicking (mouse) or long-pressing (touch) a Grid row. |
new tab
Source code
context-menu-basic.ts
ContextMenuBasic.java
Dividers
You can use dividers to separate and group related content. Use dividers sparingly to avoid creating unnecessary visual clutter.
Important
| Open the Context Menu by right-clicking (mouse) or long-pressing (touch) a Grid row. |
new tab
Source code
context-menu-dividers.ts
ContextMenuDividers.java
Checkable Menu Items
Checkable Menu Items can be used to toggle a setting on and off.
new tab
Source code
context-menu-checkable.ts
ContextMenuCheckable.java
Hierarchical Menu
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.
Important
| Open the Context Menu by right-clicking (mouse) or long-pressing (touch) a Grid row. |
new tab
Source code
context-menu-hierarchical.ts
ContextMenuHierarchical.java
Custom Items
You can customize the items to include more than a single line of text.
Important
| Open the Context Menu by right-clicking (mouse) or long-pressing (touch) a Grid row. |
new tab
Source code
context-menu-presentation.ts
ContextMenuPresentation.java
Disabled Menu Items
You can disable menu items to show that they are unavailable.
Important
| Open the Context Menu by right-clicking (mouse) or long-pressing (touch) a Grid row. |
new tab
Source code
context-menu-disabled.ts
ContextMenuDisabled.java
Left-Click
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.
Important
| Open the Context Menu by clicking a Grid row. |
new tab
Source code
context-menu-left-click.ts
ContextMenuLeftClick.java
Best Practices
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.
Important
| Open the Context Menu by right-clicking (desktop) or long-pressing (mobile) a Grid row, or use the Menu Bar in the last column. |
new tab
Source code
context-menu-best-practices.ts
ContextMenuBestPractices.java
Context Menu vs Menu Bar
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/component, such as an overflow menu, use Menu Bar.