Class HorizontalLayout

All Implemented Interfaces:
LayoutEvents.LayoutClickNotifier, ClientConnector, Sizeable, ComponentContainer, HasComponents, HasComponents.ComponentAttachDetachNotifier, Layout.AlignmentHandler, Layout.MarginHandler, com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasComponents, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasStyle, Serializable, Iterable<com.vaadin.flow.component.Component>

@Tag("div") @CssImport("./ordered-layout.css") @CssImport("./margin.css") public class HorizontalLayout extends AbstractOrderedLayout
Legacy version of HorizontalLayout that resembles Vaadin 7/8's HorizontalLayout API as closely as possible in order to facilitate migration to newer versions of Vaadin.

HorizontalLayout is a component container, which shows the subcomponents in the order of their addition (horizontally).

Author:
Vaadin Ltd.
See Also:
  • Constructor Details

    • HorizontalLayout

      public HorizontalLayout()
      Constructs an empty HorizontalLayout.
    • HorizontalLayout

      public HorizontalLayout(com.vaadin.flow.component.Component... children)
      Constructs a HorizontalLayout with the given components. The components are added in the given order.
      Parameters:
      children - The components to add.
      See Also:
  • Method Details

    • addComponentsAndExpand

      public void addComponentsAndExpand(com.vaadin.flow.component.Component... components)
      Adds the given components to this layout and sets them as expanded. The width of this layout is set to 100% if it is currently undefined.

      The components are added in the provided order to the end of this layout. Any components that are already children of this layout will be moved to new positions.

      Overrides:
      addComponentsAndExpand in class AbstractOrderedLayout
      Parameters:
      components - the components to set, not null