Update v4.2 - New components, 10+ framework guides, and quality improvements. Visit Changelog

Tailwind CSS Tabs

Build Tailwind CSS tabs with accessible tab panels, JavaScript behavior, underline, vertical, pill, segmented, scrollable, mobile-select, and hover variants.

Requires JS

Note that this component requires the use of our Tabs plugin, else you can skip this message if you are already using Preline UI as a package.

Behavior and accessibility

Use the Tabs plugin to build accessible Tailwind CSS tab panels that switch between local content panes with JavaScript.

Dynamic tabbed interfaces, as described in the WAI ARIA Authoring Practices, require role="tablist", role="tab", role="tabpanel", and additional aria- attributes in order to convey their structure, functionality and current state to users of assistive technologies (such as screen readers). As a best practice, we recommend using <button> elements for the tabs, as these are controls that trigger a dynamic change, rather than links that navigate to a new page or location.

Underline tabs

Default tabs with an underline that marks the active item.

Tabs with icons

Add icons to tab labels while keeping the same contained tab layout.

Auto-centered tabs

Automatically scroll the tab list so the active tab stays centered.

Require JS

Note that this demo requires the use of our Scroll Nav plugin, else you can skip this message if you are already using Preline UI as a package. We also include Lodash to use the utility functions provided by this library.

This is the first item's tab body.

Tabs with badges

Add badge counts or status indicators directly inside tab labels.

Tab alignment

Center-align the tab list with .justify-center.

Right-aligned tabs

Right-align the tab list with .justify-end.

Vertical tabs

Stack the tab navigation vertically when it needs to sit beside the content.

Card-style tabs

Use a card-like container to visually separate the tab list from the page.

Scrollable tabs

Let the tab list scroll horizontally when there are more tabs than the available width.

Resize the example to see it in action.

Tabs with mobile select

Swap the tab list for a <select> on smaller screens to save horizontal space.

Resize the example to see it in action.

Segmented tabs

Use a segmented control treatment for compact tab switching.

Underline bar tabs

Use a stronger underline bar style to emphasize the active tab.

Pills on stone surface

Place pill tabs on a muted stone surface for extra contrast.

Brand-color pills

Highlight the active tab with brand-colored pill styling.

Fill and justify tabs

Stretch the tab list across the available width without forcing every item to be the same size.

Equal-width tabs

Make each tab take an equal share of the available width.

Hover-triggered tabs New

Switch panes on hover instead of click for pointer-driven interactions.

Destroy and reinitialize

Use the destroy method to remove Tabs behavior before reinitializing it.

© 2026 Preline Labs.