Annotation Interface Menu


Defines menu information for a route that should appear in an automatically populated menu.

Use Menu together with Route so the route is included when the application builds its main menu, for example with MenuConfiguration.getMenuEntries(). The route is listed only when it is accessible.

If you also use Hilla, the same annotation is picked up for the Hilla main menu when frontend/views/@layout.tsx calls createMenuItems().

Since:
24.4
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Icon to use in the menu.
    double
    Used to determine the order in the menu.
    Title to use in the menu.
  • Element Details

    • title

      String title
      Title to use in the menu. Falls back the page title if not defined.
      Returns:
      the title of the item in the menu. Empty String by default.
      Default:
      ""
    • order

      double order
      Used to determine the order in the menu. Ties are resolved based on the used title. Entries without explicitly defined ordering are put below entries with an order. Double.MIN_VALUE is the default value and considered as undefined.
      Returns:
      the order of the item in the menu. Double.MIN_VALUE by default.
      Default:
      4.9E-324
    • icon

      String icon
      Icon to use in the menu. Value can go inside a <vaadin-icon> element's icon attribute which accepts icon group and name like 'vaadin:file'. Or it can go to a <vaadin-icon> element's src attribute which takes path to the icon. E.g. 'line-awesome/svg/lock-open-solid.svg'.
      Returns:
      A String for an icon. Empty String by default.
      Default:
      ""