Current Vaadin's Tabs
component doesn't include an API to show a Component
when a tab is clicked. You have to code the logic to show and hide components depending on the selected tab. This component frees you from implementing such logic. Here's an example:
PagedTabs tabs = new PagedTabs();
tabs.add(component, "Tab caption 1");
tabs.add(component2, "Tab caption 2");
You can make a tab closable as follows:
PagedTabs tabs = new PagedTabs();
tabs.add(new Span("Close me"), "Closeable");
You can use the Tab
class as well if, for example, you want to add components to the tab itself:
Tab tab = new Tab();
tab.add(new Span("Tab caption"), new Button("Click me"));
PagedTabs tabs = new PagedTabs();
tabs.add(new Span("Tab content"), tab);