Is it possible to add a visual separator into the Tabs component between tabs? I tried to add Hr component into the verticals Tabs but it failed with an error that only Tab can be added to the Tabs component.
UPDATED
This is what I have:
This is what I need:
The code
Tabs tabs = new Tabs();
Tab jobsTab = VaadinUtils.createVerticalTab(VaadinIcon.WORKPLACE, getTranslation("jobs.catalog"), AllJobsView.class, null);
tabs.add(jobsTab);
public static Tab createVerticalTab(VaadinIcon viewIcon, String viewName, Class<? extends Component> navigationTarget, Span counterSpan) {
Icon icon = viewIcon.create();
Direction currentLanguageDirection = VaadinUtils.getCurrentLanguageDirection();
switch (currentLanguageDirection) {
case LEFT_TO_RIGHT -> {
icon.getStyle()
.set("box-sizing", "border-box")
.set("margin-inline-end", "var(--lumo-space-m)")
.set("margin-inline-start", "var(--lumo-space-xs)")
.set("padding", "var(--lumo-space-xs)");
}
case RIGHT_TO_LEFT -> {
icon.getStyle()
.set("box-sizing", "border-box")
.set("margin-inline-end", "var(--lumo-space-xs)")
.set("margin-inline-start", "var(--lumo-space-m)")
.set("padding", "var(--lumo-space-xs)");
}
}
RouterLink link = new RouterLink();
link.add(icon, new Span(viewName));
if (counterSpan != null) {
link.add(counterSpan);
}
link.setRoute(navigationTarget);
link.setTabIndex(-1);
return new Tab(link);
}