Docs

Documentation versions (currently viewingVaadin 25)
Documentation translations (currently viewingEnglish)

Vertical Layout Styling

Styling API reference for the Vertical Layout component.

Style Variants

Vertical Layout supports the following style variants:

Variant Supported by

margin

Aura, Lumo

padding

Aura, Lumo

spacing

Aura, Lumo

wrap

Aura, Lumo

Spacing

Spacing is used to create space between components in the same layout. Spacing can help prevent misclicks and distinguish content areas.

Source code
VerticalLayoutSpacing.java
vertical-layout-spacing.tsx
vertical-layout-spacing.ts

Five different spacing style variants are available:

Source code
vertical-layout-spacing-variants.ts
Style Variant Usage Recommendation

spacing-xs

Extra-small space between items.

spacing-s

Small space between items.

spacing

Medium space between items.

spacing-l

Large space between items.

spacing-xl

Extra-large space between items.

Source code
Java
VerticalLayout layout = new VerticalLayout();
layout.setSpacing(false);
layout.getThemeList().add("spacing-xs");
Java
tsx
tsx
HTML
HTML

Alternatively, the spacing can be set to a custom value:

Source code
Java
VerticalLayout layout = new VerticalLayout();
layout.setSpacing(12, Unit.PIXELS);
Java
tsx
tsx
HTML
HTML

Padding

Padding is the space allocated between the content in a layout and the outer border. This should not be confused with Margin, which is explained in the next section.

Padding can help distinguish the content in a layout from its surrounding. Padding is applied using the padding style variant.

Source code
VerticalLayoutPadding.java
vertical-layout-padding.tsx
vertical-layout-padding.ts

Margin

Margin is the space around a layout. This is different from Padding, which is explained in the previous section.

Source code
VerticalLayoutMargin.java
vertical-layout-margin.tsx
vertical-layout-margin.ts

Wrapping

By default, components in a layout either shrink or overflow when there isn’t enough vertical space. Enable wrapping to allow components to flow onto a new column when space runs out, preventing overflow.

Source code
VerticalLayoutWrapping.java
vertical-layout-wrapping.tsx
vertical-layout-wrapping.ts

Style Properties

The following style properties can be used in CSS stylesheets to customize the appearance of this component.

To apply values to these properties globally in your application UI, place them in a CSS block using the html {…​} selector. See Component Style Properties for more information on style properties.

Property Supported by

--vaadin-vertical-layout-gap

Aura, Lumo

--vaadin-vertical-layout-padding

Aura, Lumo

--vaadin-vertical-layout-margin

Aura, Lumo

CSS Selectors

The following CSS selectors can be used in stylesheets to target the various parts and states of the component. See the Styling documentation for more details on how to style components.

Root element

vaadin-vertical-layout