Class VerticalLayout

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.orderedlayout.VerticalLayout
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.ClickNotifier<VerticalLayout>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasComponents, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasOrderedComponents, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasTheme, FlexComponent, ThemableLayout, com.vaadin.flow.component.shared.HasThemeVariant<VerticalLayoutVariant>, Serializable

@Tag("vaadin-vertical-layout") @NpmPackage(value="@vaadin/vertical-layout", version="25.1.0-alpha9") @JsModule("@vaadin/vertical-layout/src/vaadin-vertical-layout.js") public class VerticalLayout extends com.vaadin.flow.component.Component implements ThemableLayout, FlexComponent, com.vaadin.flow.component.ClickNotifier<VerticalLayout>, com.vaadin.flow.component.shared.HasThemeVariant<VerticalLayoutVariant>
Vertical Layout places components top-to-bottom in a column. By default, it has 100% width and undefined height, meaning its width is constrained by its parent component and its height is determined by the components it contains.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.orderedlayout.FlexComponent

    FlexComponent.Alignment, FlexComponent.JustifyContentMode
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs an empty layout with spacing and padding on by default.
    VerticalLayout(com.vaadin.flow.component.Component... children)
    Convenience constructor to create a layout with the children already inside it.
    VerticalLayout(FlexComponent.Alignment alignment, com.vaadin.flow.component.Component... children)
    Convenience constructor to create a layout with the children and specified horizontal alignment.
    VerticalLayout(FlexComponent.JustifyContentMode justifyContentMode, com.vaadin.flow.component.Component... children)
    Convenience constructor to create a layout with the children and specified justifyContentMode.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAndExpand(com.vaadin.flow.component.Component... components)
    Adds the given components to this layout and sets them as expanded.
    getAlignSelf(com.vaadin.flow.component.HasElement component)
    Gets the default horizontal alignment used by all components without individual alignments inside the layout.
    getHorizontalComponentAlignment(com.vaadin.flow.component.Component component)
    Gets the individual horizontal alignment of a given component.
    void
    void
    setAlignSelf(FlexComponent.Alignment alignment, com.vaadin.flow.component.HasElement... components)
    void
    Sets the default horizontal alignment to be used by all components without individual alignments inside the layout.
    void
    setHorizontalComponentAlignment(FlexComponent.Alignment alignment, com.vaadin.flow.component.Component... componentsToAlign)
    Sets a horizontal alignment for individual components inside the layout.
    void
    setPadding(boolean padding)
    Toggles padding theme setting for the element.
    void
    setSpacing(boolean spacing)
    Toggles spacing theme setting for the element.

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, bindVisible, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.ClickNotifier

    addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.orderedlayout.FlexComponent

    expand, getFlexGrow, getFlexShrink, getJustifyContentMode, replace, setFlexGrow, setFlexShrink, setJustifyContentMode

    Methods inherited from interface com.vaadin.flow.component.HasComponents

    add, add, add, addComponentAsFirst, addComponentAtIndex, bindChildren, remove, remove, removeAll

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasEnabled

    bindEnabled, isEnabled, setEnabled

    Methods inherited from interface com.vaadin.flow.component.HasOrderedComponents

    getChildren, getComponentAt, getComponentCount, indexOf

    Methods inherited from interface com.vaadin.flow.component.HasSize

    bindHeight, bindWidth, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, bindClassName, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName

    Methods inherited from interface com.vaadin.flow.component.HasTheme

    addThemeName, addThemeNames, bindThemeName, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName

    Methods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant

    addThemeVariants, bindThemeVariant, removeThemeVariants, setThemeVariant, setThemeVariants, setThemeVariants

    Methods inherited from interface com.vaadin.flow.component.orderedlayout.ThemableLayout

    getBoxSizing, getSpacing, getThemeList, isMargin, isPadding, isSpacing, isWrap, setBoxSizing, setMargin, setSpacing, setSpacing, setWrap
  • Constructor Details

    • VerticalLayout

      public VerticalLayout()
      Constructs an empty layout with spacing and padding on by default.
    • VerticalLayout

      public VerticalLayout(com.vaadin.flow.component.Component... children)
      Convenience constructor to create a layout with the children already inside it.
      Parameters:
      children - the items to add to this layout
      See Also:
      • HasComponents.add(Component...)
    • VerticalLayout

      public VerticalLayout(FlexComponent.JustifyContentMode justifyContentMode, com.vaadin.flow.component.Component... children)
      Convenience constructor to create a layout with the children and specified justifyContentMode.
      Parameters:
      justifyContentMode - the justifyContentMode
      children - the items to add to this layout
      See Also:
    • VerticalLayout

      public VerticalLayout(FlexComponent.Alignment alignment, com.vaadin.flow.component.Component... children)
      Convenience constructor to create a layout with the children and specified horizontal alignment.
      Parameters:
      alignment - the horizontal alignment
      children - the items to add to this layout
      See Also:
  • Method Details