Annotation Interface 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 ElementsModifier and TypeOptional ElementDescriptionIcon to use in the menu.doubleUsed to determine the order in the menu.The menu entry to nest this entry under in a hierarchical menu, such as the one built fromMenuConfiguration.getMenuEntriesTree().Title to use in the menu.
-
Element Details
-
title
String titleTitle 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 orderUsed 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_VALUEis the default value and considered as undefined.- Returns:
- the order of the item in the menu.
Double.MIN_VALUEby default.
- Default:
4.9E-324
-
icon
String iconIcon to use in the menu. Value can go inside a<vaadin-icon>element'siconattribute which accepts icon group and name like 'vaadin:file'. Or it can go to a<vaadin-icon>element'ssrcattribute 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:
""
-
parent
The menu entry to nest this entry under in a hierarchical menu, such as the one built fromMenuConfiguration.getMenuEntriesTree().Use this when the menu hierarchy does not match the route hierarchy: by default an entry is nested under the route it logically belongs to (defined by
RouteParent, or derived from the route URL, where the root route""is not used as a parent), and defining a parent here overrides that for the menu only. It has no effect on navigation or on the flatMenuConfiguration.getMenuEntries().The parent does not have to be a direct route ancestor of the annotated route. If the given parent is not itself part of the menu, the entry is nested under the nearest ancestor of that parent which is, or becomes a root entry when there is none.
- Returns:
- the menu parent navigation target, or
Componentitself, the default, when the route hierarchy should be used
- Default:
com.vaadin.flow.component.Component.class
-