Search in sources :

Example 1 with Nav

use of com.vaadin.flow.component.html.Nav in project sapl-demos by heutelbeck.

the class MainLayout method createNavigation.

private Nav createNavigation() {
    Nav nav = new Nav();
    nav.addClassNames("border-b", "border-contrast-10", "flex-grow", "overflow-auto");
    nav.getElement().setAttribute("aria-labelledby", "views");
    H3 views = new H3("Views");
    views.addClassNames("flex", "h-m", "items-center", "mx-m", "my-0", "text-s", "text-tertiary");
    views.setId("views");
    // Wrap the links in a list; improves accessibility
    UnorderedList list = new UnorderedList();
    list.addClassNames("list-none", "m-0", "p-0");
    nav.add(list);
    for (RouterLink link : createLinks()) {
        ListItem item = new ListItem(link);
        list.add(item);
    }
    return nav;
}
Also used : RouterLink(com.vaadin.flow.router.RouterLink) Nav(com.vaadin.flow.component.html.Nav) UnorderedList(com.vaadin.flow.component.html.UnorderedList) H3(com.vaadin.flow.component.html.H3) ListItem(com.vaadin.flow.component.html.ListItem)

Example 2 with Nav

use of com.vaadin.flow.component.html.Nav in project Akros-Marketplace by AkrosAG.

the class MainLayout method createHeaderContent.

private Component createHeaderContent() {
    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("Akros Marketplace Administration");
    appName.addClassNames("my-0", "me-auto", "text-xl");
    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);
    for (RouterLink link : createLinks()) {
        ListItem item = new ListItem(link);
        list.add(item);
    }
    header.add(layout, nav);
    return header;
}
Also used : Div(com.vaadin.flow.component.html.Div) RouterLink(com.vaadin.flow.router.RouterLink) 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) ListItem(com.vaadin.flow.component.html.ListItem)

Example 3 with Nav

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

the class _SideMenuLayout method createNavigation.

// -- HELPER
private Nav createNavigation(final Iterable<MenuItemInfo> menuItems) {
    Nav nav = new Nav();
    nav.addClassNames("border-b", "border-contrast-10", "flex-grow", "overflow-auto");
    nav.getElement().setAttribute("aria-labelledby", "views");
    // Wrap the links in a list; improves accessibility
    UnorderedList list = new UnorderedList();
    list.addClassNames("list-none", "m-0", "p-0");
    nav.add(list);
    menuItems.forEach(list::add);
    return nav;
}
Also used : Nav(com.vaadin.flow.component.html.Nav) UnorderedList(com.vaadin.flow.component.html.UnorderedList)

Example 4 with Nav

use of com.vaadin.flow.component.html.Nav 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

Nav (com.vaadin.flow.component.html.Nav)4 UnorderedList (com.vaadin.flow.component.html.UnorderedList)4 Div (com.vaadin.flow.component.html.Div)2 H1 (com.vaadin.flow.component.html.H1)2 Header (com.vaadin.flow.component.html.Header)2 ListItem (com.vaadin.flow.component.html.ListItem)2 RouterLink (com.vaadin.flow.router.RouterLink)2 H3 (com.vaadin.flow.component.html.H3)1