Introduction
The tabs component allows you to render a set of tabs, which can be used to toggle between multiple sections of content:Triggering the active state of the tab
By default, tabs do not appear “active”. To make a tab appear active, you can use theactive attribute:
active attribute to make a tab appear active conditionally:
alpine-active attribute to make a tab appear active conditionally using Alpine.js:
Setting a tab icon
Tabs may have an icon, which you can set using theicon attribute:
Setting the tab icon position
The icon of the tab may be positioned before or after the label using theicon-position attribute:
Setting a tab badge
Tabs may have a badge, which you can set using thebadge slot:
Using a tab as an anchor link
By default, a tab’s underlying HTML tag is<button>. You can change it to be an <a> tag by using the tag attribute:
Using vertical tabs
You can render the tabs vertically by using thevertical attribute: