Docs

Documentation versions (currently viewingVaadin 25 (prerelease))

Tabs Styling

Styling API reference for the Tab Sheet and Tabs components.

Style Variants

The following variants are supported by the Tabs:

Variant Description Supported by

centered

Aligns tab elements to the center

Lumo

equal-width-tabs

Makes each tab share equally the available space

Lumo

small

Reduces the size of tabs

Lumo

minimal

Reduces visual styles to a minimum

Lumo

hide-scroll-buttons

Hides scroll buttons when the content overflows

Aura, Lumo

show-scroll-buttons

Shows scroll buttons when the content overflows

Aura, Lumo

filled

Uses a solid background color for tabs

Aura

In addition to the above, the following variants are supported by the Tab Sheet:

Variant Description Supported by

bordered

Shows border around the tab sheet component

Lumo

no-border

Removes border around the tab sheet component

Aura

no-padding

Removes the padding from the tab sheet content area

Aura, Lumo

Centered

By default, tabs are left-aligned. They can be centered using the centered variant.

Source code
TabsThemeCentered.java
tabs-theme-centered.tsx
tabs-theme-centered.ts

You can use this variant to suit your visual and stylistic preference. It’s typically used for top-level navigation. However, use it only where appropriate since by default left-aligned tabs are more discoverable and what most users expect.

Equal-Width Tabs

Apply the equal-width-tabs variant to make each tab share equally the available space. This disables the ability to scroll, though, since the content never overflows.

Source code
TabsThemeEqualWidth.java
tabs-theme-equal-width.tsx
tabs-theme-equal-width.ts

Use this variant when there are a small number of tabs in a narrow space, such as for a tabbed sidebar and for mobile (i.e., portrait) layouts.

Minimal

The minimal variant reduces visual styles to a minimum.

Source code
TabsThemeMinimal.java
tabs-theme-minimal.tsx
tabs-theme-minimal.ts

You can generally use this to reduce visual clutter. However, use it with caution as it reduces the visual distinction of selected tabs to color only. This can be difficult to discern for many users.

Small

The small variant can be used to make the Tabs smaller. This can be good when space is limited. Compare the tabs here to previous ones. You can see these are slightly smaller.

Source code
TabsThemeSmall.java
tabs-theme-small.tsx
tabs-theme-small.ts

Bordered

The bordered variant adds a border around the Tab Sheet component.

Source code
TabSheetThemeBordered.java
tabsheet-theme-bordered.tsx
tabsheet-theme-bordered.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.

Tab Properties

Property Supported by

--vaadin-tab-background

Aura

--vaadin-tab-border-color

Aura

--vaadin-tab-border-radius

Aura

--vaadin-tab-border-width

Aura

--vaadin-tab-font-size

Aura

--vaadin-tab-font-weight

Aura

--vaadin-tab-gap

Aura

--vaadin-tab-line-height

Aura

--vaadin-tab-padding

Aura

--vaadin-tab-text-color

Aura

Tabs Properties

Property Supported by

--vaadin-tabs-background

Aura

--vaadin-tabs-border-color

Aura

--vaadin-tabs-border-radius

Aura

--vaadin-tabs-border-width

Aura

--vaadin-tabs-gap

Aura

--vaadin-tabs-padding

Aura

Tab Sheet Properties

Property Supported by

--vaadin-tabsheet-border-color

Aura

--vaadin-tabsheet-border-radius

Aura

--vaadin-tabsheet-border-width

Aura

--vaadin-tabsheet-gap

Aura

--vaadin-tabsheet-padding

Aura

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.

Tabsheet

Root element

vaadin-tabsheet

Tabs wrapper

vaadin-tabsheet::part(tabs-container)

Content wrapper

vaadin-tabsheet::part(content)

Content loading indicator

vaadin-tabsheet::part(loader)

Tabs

Root element

vaadin-tabs

Horizontal tabs

vaadin-tabs[orientation="horizontal"]

Vertical tabs

vaadin-tabs[orientation="vertical"]

Tab container

vaadin-tabs::part(tabs)

Back button

vaadin-tabs::part(back-button)

Back button icon

vaadin-tabs::part(back-button)::after

Forward button

vaadin-tabs::part(forward-button)

Forward button icon

vaadin-tabs::part(forward-button)::after

Tab

Root element

vaadin-tab

Selected

vaadin-tab[selected]

Focused

vaadin-tab[focused]

Keyboard focused

vaadin-tab[focus-ring]

Pressed

vaadin-tab[active]

Hovered

vaadin-tab:hover

Disabled

vaadin-tab[disabled]

Selection indicator

vaadin-tab::before

Icon in tab

vaadin-tab > vaadin-icon