drawerToggle

A toggle component that controls the visibility a menu drawer.

  • XML element: drawerToggle

  • Java class: DrawerToggle

Basics

The drawerToggle component creates a toggle button that controls the opening and closing of the drawerLayout containing main menu items.

drawer toggle basic

To ensure users can access the main menu across the application, drawerToggle is usually placed within the navigationBar component of the main application view.

Theme Variants

Use the themeNames attribute to customize component’s color and size.

Color

Choose among four color variants: default, success, error, and contrast. Combine the color variants with the primary theme to add extra emphasis.

Size

Three size options are available: small, default, large.

Handlers

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

ClickEvent

The com.vaadin.flow.component.ClickEvent is fired when the component is clicked. This handler must specify one of the following three subjects to detect the number of clicks related to the event.

  • click – fires the event whenever the component is clicked.

  • singleClick – fires the event after a timeout to ensure it is not a double click.

  • doubleClick – fires the event when the component is double-clicked.

Elements