Tabs Styling
Style Variants
The following variants are supported by the Tabs:
| Variant | Description | Supported by |
|---|---|---|
| Aligns tab elements to the center | Lumo |
| Makes each tab share equally the available space | Lumo |
| Reduces the size of tabs | Lumo |
| Reduces visual styles to a minimum | Lumo |
| Hides scroll buttons when the content overflows | Aura, Lumo |
| Shows scroll buttons when the content overflows | Aura, Lumo |
| 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 |
|---|---|---|
| Shows border around the tab sheet component | Lumo |
| Removes border around the tab sheet component | Aura |
| 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.
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.
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.
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 |
|---|---|
| Aura |
| Aura |
| Aura |
| Aura |
| Aura |
| Aura |
| Aura |
| Aura |
| Aura |
| 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