REF: Positioning of Components

…Whats the best way of positioning components in vaadin especially when using Java. I specifically trying to find out how to “center” align a form in a verticalLayout.

Is there documentation explaining alignments, positioning and so on.

Teddy L.

Hey Teddy,

Both HorizontalLayout and VerticalLayout relies on [flexbox]
(https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox).

You can center items in a VerticalLayout with either:

  1. Java API: setAlignItems(Alignment.CENTER);.
  2. CSS: align-items: center;.