On This Page
An tab layout layouts panels in tabs, only one of the tab contents is visible at a time.
- Fluent
- Declarative
TabLayout.builder()
.tabs(List.of(
new Tab("Tab 1", new Text("Tab 1")),
new Tab("Tab 2", new Text("Tab 2")),
new Tab("Tab 3", new Text("Tab 3"))
))
.build()
copy
public class FormWithTabs {
@Tab("Tab 1")
Object panel1 = new Text("Panel 1");
@Tab("Tab 2")
Object panel2 = new Text("Panel 2");
@Tab("Tab 3")
Object panel3 = new Text("Panel 3");
}
copyAvailable properties
This is the list of available properties for a accordion layout:
| Property | Description | Notes |
|---|---|---|
| id | id for this component | |
| cssClasses | list of css classes | content of the css attribute |
| style | inline style attributes | content of the style attribute |
| fullWidth | shortcut to set width:100% | true/false |
| orientation | one of horizontal, vertical | |
| variant | one of centered, equalwidth, minimal, small, bordered |
You can see a full explanation of those properties at https://vaadin.com/docs/latest/components/tabs