Using LineAwesome with @Menu in Flow works like:
@Menu(order = 10, icon = LineAwesomeIconUrl.LIST_UL_SOLID)
But how do I use it with VaadinIcon?
Things that does not work:
@Menu(order = 10, icon = "vaadin:file") // this is what JavaDocs says
@Menu(order = 10, icon = "file")
@Menu(order = 10, icon = "FILE")
@Menu(order = 10, icon = VaadinIcon.FILE)
@Menu(order = 10, icon = VaadinIcon.FILE.name())
As a general request: Is this the recommended way to build AppLayout SideNav elements these days?
knoobie
(Christian Knoop)
September 22, 2025, 1:58pm
2
Depends. I would say no. It’s imho just a quick thing to get started. I would always roll out my own implementation to get proper support for e.g. nesting, i18n or dynamic menus
Thanks. Yeah - in the meanwhile implemented my SideNav like before. This way I can additionally only show elements that the user is allowed to see:
private <T extends Component> void addSideNavItemTo(SideNav sideNav, String label, Class<T> navigationTarget, VaadinIcon icon) {
if (accessAnnotationChecker.hasAccess(navigationTarget)) {
sideNav.addItem(new SideNavItem(label, navigationTarget, icon.create()));
}
}
I always wondered, if the access check shouldn’t be a default feature of Vaadin? Does it make sense to show menu items to views that the user is not allowed to enter?
knoobie
(Christian Knoop)
September 22, 2025, 5:28pm
4
As far as I know the Menuregistry of Vaadin should do a similar check.
Tatu2
(Tatu Lund)
January 15, 2026, 7:06am
5
It works when I populate the SideNav in drawer using code like this:
SideNav sideNav = new SideNav();
MenuConfiguration.getMenuEntries().forEach(menuEntry -> {
Icon icon = new Icon();
icon.setIcon(menuEntry.icon());
SideNavItem item = new SideNavItem(menuEntry.title(), menuEntry.path(), icon);
sideNav.addItem(item);
});
add(sideNav);