Class DrawerToggle

All Implemented Interfaces:
AttachNotifier, BlurNotifier<Button>, ClickNotifier<Button>, DetachNotifier, Focusable<Button>, FocusNotifier<Button>, HasElement, HasEnabled, HasSize, HasStyle, HasText, HasTheme, HasPrefix, HasSuffix, HasThemeVariant<ButtonVariant>, HasTooltip, Serializable

@Tag("vaadin-drawer-toggle") @NpmPackage(value="@vaadin/polymer-legacy-adapter",version="24.0.12") @NpmPackage(value="@vaadin/app-layout",version="24.0.12") @JsModule("@vaadin/polymer-legacy-adapter/style-modules.js") @JsModule("@vaadin/app-layout/src/vaadin-drawer-toggle.js") public class DrawerToggle extends Button
Server-side component for the <vaadin-drawer-toggle> element. It is a button that allows the user to open and close the drawer. To use it, add it to the AppLayout, typically in the navbar slot. AppLayout layout = new AppLayout(); layout.addToNavbar(new DrawerToggle());
See Also:
  • Constructor Details

    • DrawerToggle

      public DrawerToggle()
  • Method Details

    • setIcon

      public void setIcon(Component icon)
      Description copied from class: Button
      Sets the given component as the icon of this button.

      Even though you can use almost any component as an icon, some good options are Icon and Image.

      Use Button.setIconAfterText(boolean) to change the icon's position relative to the button's text content.

      This method also sets or removes this button's theme=icon attribute based on whether this button contains only an icon after this operation or not.

      Overrides:
      setIcon in class Button
      Parameters:
      icon - component to be used as an icon, may be null to only remove the current icon, can't be a text-node