Class Board

  • All Implemented Interfaces:
    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.HasOrderedComponents, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, Serializable

    @Tag("vaadin-board")
    @NpmPackage(value="@vaadin/polymer-legacy-adapter",version="23.6.2") @NpmPackage(value="@vaadin/board",version="23.6.2") @NpmPackage(value="@vaadin/vaadin-board",version="23.6.2")
    @JsModule("@vaadin/polymer-legacy-adapter/style-modules.js") @JsModule("@vaadin/board/src/vaadin-board.js")
    public class Board
    extends com.vaadin.flow.component.Component
    implements com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasOrderedComponents
    Vaadin Board allows creating responsive layouts in an easy way.

    A Board consists of Rows where you can add any Vaadin component. Each Row consists of four columns, and can contain up to four components taking one column each, or fewer components with multiple columns each as long as sum of columns stays less than or equal to four.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Board()
      Creates an empty board.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Row addRow​(com.vaadin.flow.component.Component... components)
      Creates a new row and adds the given components to the row.
      void redraw()
      Forces the board to be redrawn.
      void removeRow​(Row row)
      Removes the given row from the board.
      • Methods inherited from class com.vaadin.flow.component.Component

        addListener, 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, scrollIntoView, set, setElement, setId, setVisible
      • Methods inherited from interface com.vaadin.flow.component.AttachNotifier

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

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

        add, add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAll
      • Methods inherited from interface com.vaadin.flow.component.HasElement

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

        isEnabled, setEnabled
      • Methods inherited from interface com.vaadin.flow.component.HasOrderedComponents

        getChildren, getComponentAt, getComponentCount, indexOf, replace
      • Methods inherited from interface com.vaadin.flow.component.HasSize

        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, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
    • Constructor Detail

      • Board

        public Board()
        Creates an empty board.

        Use addRow(Component...) to add content to the board.

    • Method Detail

      • addRow

        public Row addRow​(com.vaadin.flow.component.Component... components)
        Creates a new row and adds the given components to the row.

        All the added components have cols set to 1, i.e. use one slot in the row. The number of slots in the row is the number of added components.

        Parameters:
        components - components to add, no more than 4
        Returns:
        a row instance which can be used for further configuration
        Throws:
        IllegalArgumentException - if there are more than 4 components
      • removeRow

        public void removeRow​(Row row)
        Removes the given row from the board.
        Parameters:
        row - the row to be removed
      • redraw

        public void redraw()
        Forces the board to be redrawn.

        This method typically only needs to be called if you change CSS (through a variable or otherwise) which affects the size of the board or the breakpoints used. Otherwise, the component will be redrawn automatically when needed.