No it’s not possible to get the button via element API.
However, if your goal is to style the buttons differently, that would be achievable by adding your own style sheet using [@CssImport]
(https://vaadin.com/docs/v14/themes/importing-style-sheets.html). The following code has not been tested, but should only bring the point across.
@CssImport(value = "./styles/myMenuBarStyles.css", themeFor = "vaadin-menu-bar")
public class MainView ..... {
...
}
@Kaspar Scherrer: thanks!
This way, how to style the menu buttons individually?
The way you described helps me to have a common style for all the menu items, but what if I would like to have different styles for the first menu item than the others?