The typical menu bar.

  • Fluent
  • Declarative

   MenuBar.builder()
          .options(List.of(
                  new RouteLink("/fluent-app/nested-apps/left/home", "Home"),
                  new RouteLink("/fluent-app/nested-apps/left/page1", "Page 1"),
                  (Actionable) new Menu("Submenu", List.of(
                          new RouteLink("/fluent-app/nested-apps/left/home", "Home"),
                          new RouteLink("/fluent-app/nested-apps/left/page1", "Page 1")
                  ))
          ))
          .build()
copy

TBD

Available properties

This is the list of available properties for a context menu:

PropertyDescriptionNotes
idid for this component
cssClasseslist of css classescontent of the css attribute
styleinline style attributescontent of the style attribute
optionslist of menu options, as Actionables

And above is the list of classes implementing the Actionable interface, and their properties.

Common properties for all Actionables

These properties are common to all the menu options

PropertyDescriptionNotes
labeltext to show. Only if no component is supplied
selectedif this options must appear as checked
componentany component to be displayed instead of label
classNameany css class name
disabledif this option must appear as disabled
disabledOnClickif this option must be disabled on click
itemDataany object. It will travel back to the backend, if this option is selected

Use it for taking the user to a concrete route

PropertyDescriptionNotes
routeroute to navigate to
targetany of Top, Parent

The divider has no properties. Just draws an horizontal line.

PropertyDescriptionNotes
submenua list of Actionables (the menu options)
PropertyDescriptionNotes
componentSuppliera component supplier

You can see a full explanation of those properties at https://vaadin.com/docs/latest/components/menu-bar