Search in sources :

Example 6 with Header

use of com.vaadin.flow.component.html.Header in project isis-lab by apache-isis-committers.

the class _TopMenuLayout method createHeaderContent.

Component createHeaderContent(final Iterable<MenuItemInfo> menuItems) {
    Header header = new Header();
    header.addClassNames("bg-base", "border-b", "border-contrast-10", "box-border", "flex", "flex-col", "w-full");
    Div layout = new Div();
    layout.addClassNames("flex", "h-xl", "items-center", "px-l");
    H1 appName = new H1("isis-lab-experiments-layout");
    appName.addClassNames("my-0", "me-auto", "text-l");
    layout.add(appName);
    Nav nav = new Nav();
    nav.addClassNames("flex", "gap-s", "overflow-auto", "px-m");
    // Wrap the links in a list; improves accessibility
    UnorderedList list = new UnorderedList();
    list.addClassNames("flex", "list-none", "m-0", "p-0");
    nav.add(list);
    menuItems.forEach(list::add);
    header.add(layout, nav);
    return header;
}
Also used : Div(com.vaadin.flow.component.html.Div) Nav(com.vaadin.flow.component.html.Nav) Header(com.vaadin.flow.component.html.Header) H1(com.vaadin.flow.component.html.H1) UnorderedList(com.vaadin.flow.component.html.UnorderedList)

Aggregations

Header (com.vaadin.flow.component.html.Header)6 H1 (com.vaadin.flow.component.html.H1)3 DrawerToggle (com.vaadin.flow.component.applayout.DrawerToggle)2 Div (com.vaadin.flow.component.html.Div)2 Nav (com.vaadin.flow.component.html.Nav)2 UnorderedList (com.vaadin.flow.component.html.UnorderedList)2 Button (com.vaadin.flow.component.button.Button)1 Footer (com.vaadin.flow.component.html.Footer)1 H2 (com.vaadin.flow.component.html.H2)1 H4 (com.vaadin.flow.component.html.H4)1 ListItem (com.vaadin.flow.component.html.ListItem)1 Scroller (com.vaadin.flow.component.orderedlayout.Scroller)1 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)1 RouterLink (com.vaadin.flow.router.RouterLink)1 lombok.val (lombok.val)1