Vaadin Elements - Context Menu - The Menu Template

The Menu Template

The vaadin-context-menu element expects a child template with the overlay contents.

You can use any elements in the template to build the actual menu. It is recommended to use paper-menu and paper-item for the basic single-level menu use case:

<vaadin-context-menu>
  <template>
    <paper-menu>
      <paper-item>First menu item</paper-item>
      <paper-item>Second menu item</paper-item>
    </paper-menu>
  </template>

  <p>This paragraph has the context menu provided in the above template.</p>
  <p>Another paragraph with the context menu.</p>
</vaadin-context-menu>
vaadin context menu on content
Figure 1. vaadin-context-menu built with paper-menu and paper-item elements