Documentation versions (currently viewingVaadin 14)

You are viewing documentation for an older Vaadin version. View latest documentation

App Layout 2 Migration Guide

Version 2 of AppLayout is introduced in Vaadin 14 and comes with several breaking changes.


AbstractAppRouterLayout was removed. AppLayout itself now implements RouterLayout. If you have a view like that extended AbstractRouterLayout

public class MyView extends AbstractRouterLayout {

It should now extend AppLayout

public class MyView extends AppLayout {

AppLayoutMenu and AppLayoutMenuItem were removed. The same functionality can be achieved by using vaadin-tabs. AppLayoutMenu can be directly replaced with Tabs.

Tabs menu = new Tabs();

To mimick AppLayoutMenu’s look, use horizontal orientation and place the menu in the navbar.

appLayout.addToNavbar(true, tabs);

Use vaadin-tab for menu items. To create a navigation item, the recommended approach is to add a router link inside the tab.

RouterLink link = new RouterLink(null,TargetView.class);
link.add("link text");
Tab tab = new Tab();

Additionally, use the appropriate theme variant to place the icon on top of the tab.


Branding on navbar

To keep the same look of the previous version with the branding on the top left and having the menu center, add both elements to the navbar.

Span appName = new Span("Branding");

this.addToNavbar(true, appName, tabs);

and add some styles to shared-styles.html

<dom-module id="app-layout-theme" theme-for="vaadin-app-layout">
      [part="navbar"] {
        align-items: center;
        justify-content: center;
      [part="navbar"]::after {
        content: '';
      [part="navbar"] ::slotted(*:first-child),
      [part="navbar"]::after {
        flex: 1 0 0.001px;
      @media (max-width: 425px) {
        [part="navbar"] ::slotted(.hide-on-mobile) {
          display: none;
        [part="navbar"]::after {
          content: none;

    vaadin-app-layout vaadin-tab a:hover {
      text-decoration: none;
    vaadin-app-layout vaadin-tab:not([selected]) a {
      color: var(--lumo-contrast-60pct);
    vaadin-app-layout vaadin-tab iron-icon {
      margin: 0 4px;
      width: var(--lumo-icon-size-m);
      height: var(--lumo-icon-size-m);
      padding: .25rem;
      box-sizing: border-box!important;

New DrawerToggle to open or close the drawer.

To use it, add a instance to the component, tipically to the navbar. It will cause a button to appear that will toggle the navbar when clicked.

appLayout.addToNavbar(new DrawerToggle());