items

Defines a (hierarchical) menu structure for the component. If a menu item has a non-empty children set, a sub-menu with the child items is opened next to the parent menu on mouseover, tap or a right arrow keypress.

The items API can't be used together with a renderer!

Example

contextMenu.items = [
{ text: 'Menu Item 1', theme: 'primary', className: 'first', children:
[
{ text: 'Menu Item 1-1', checked: true, keepOpen: true },
{ text: 'Menu Item 1-2' }
]
},
{ component: 'hr' },
{ text: 'Menu Item 2', children:
[
{ text: 'Menu Item 2-1' },
{ text: 'Menu Item 2-2', disabled: true }
]
},
{ text: 'Menu Item 3', disabled: true, className: 'last' }
];

Item tooltips

Menu items can have tooltips that are shown on hover and keyboard focus. To enable them, add a slotted <vaadin-tooltip> element and set the tooltip property on each item that should have one:

<vaadin-context-menu>
<vaadin-tooltip slot="tooltip"></vaadin-tooltip>
</vaadin-context-menu>