Does only the Grid component support context menus?

According to the documentation, a context menu can be used with any component:

Context Menu is a component that you can attach to any component to display a context menu.

All examples in the documentation use always the Grid component. That is the only component I could find that has an addContextMenu() method. I was not able to find any other component that supports context menus. What did I miss?

The second example in the docs " Checkable Menu Items" shows how to do it; it’s just menu.setTarget(component)

1 Like

Got it! Looks like I have missed that example. But it would be better to provide a simple ContextMenu example first before diving into the Grid.

Thanks for pointing out, it works like a charm!


I second that especially because the grid docs has a section about context menu Grid | Components | Vaadin Docs

But it gets even worse Unable to reuse menu items in ContextMenu and GridContextMenu · Issue #1408 · vaadin/flow-components · GitHub

1 Like