Skip to main content

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 the active attribute:
You can also use the active attribute to make a tab appear active conditionally:
Or you can use the 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 the icon attribute:

Setting the tab icon position

The icon of the tab may be positioned before or after the label using the icon-position attribute:

Setting a tab badge

Tabs may have a badge, which you can set using the badge slot:
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 the vertical attribute: