The horizontalMenu component is used to display a horizontal menu with hierarchical drop-down sub-menus.

horizontalMenu is used in the Main view with top menu template in the View Creation Wizard. If you want to use the new view instead of the existing main view, select the Use as default main view checkbox on the first step of the wizard. Then Studio will replace the layout attribute of the @Route annotation in all views and set the new view in the jmix.ui.main-view-id application property.

It can also be used on any view as any other visual component.

  • XML element: horizontalMenu

  • Java class: HorizontalMenu


To add the component on a view, place it in the view descriptor:

<horizontalMenu id="horizontalMenu" width="100%"/>
horizontal menu

You can also create and add the component to a view in a Java controller:

private UiComponents uiComponents;
private ApplicationContext applicationContext;
private VerticalLayout navigation;

public void onInit(final InitEvent event) {
    HorizontalMenu horizontalMenu = uiComponents.create(HorizontalMenu.class);

    MenuConfigHorizontalMenuItemProvider itemProvider =




The loadMenuConfig attribute is used to control the loading of menu structure from Menu Configuration. The default value is true, which means that the horizontalMenu component loads its menu structure from MenuConfig by default. If you want to use a different item provider, you should set the loadMenuConfig attribute to false first.


Чтобы сгенерировать заглушку обработчика в Jmix Studio, используйте вкладку Handlers панели инспектора Jmix UI, или команду Generate Handler, доступную на верхней панели контроллера экрана и через меню CodeGenerate (Alt+Insert / Cmd+N).