Tabs

A set of layered panels, one visible at a time, with an active-tab indicator that slides to match the current selection using a spring animation. Built on Base UI's tabs primitive, so focus management, keyboard navigation, and ARIA wiring come for free.

Last updated August 6, 2026

Overview

A quick summary of what changed, at a glance.

Variants

Pass variant to Tabs to switch the tab list's visual style.

Default
Rounded
Line
Ghost

Examples

With icons

Your feed, curated from the people you follow.

Disabled tab

Only visible to you until it's sent for review.

Controlled

Step 1 of 3 — tell us about the order.

Vertical

Name, language, and workspace preferences.

Scrollable

When the tab list overflows, edges fade to hint at more content and sharpen once you've scrolled all the way — direction aware, so it mirrors correctly in RTL.

Installation

$ npx shadcn@latest add @persianlabsui/tabs

Usage

import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
 
export function Example() {
  return (
    <Tabs defaultValue="overview">
      <TabsList>
        <TabsTrigger value="overview">Overview</TabsTrigger>
        <TabsTrigger value="activity">Activity</TabsTrigger>
      </TabsList>
      <TabsContent value="overview">Overview content</TabsContent>
      <TabsContent value="activity">Activity content</TabsContent>
    </Tabs>
  )
}

API Reference

Tabs

PropTypeDefaultDescription
valueValueundefinedThe value of the currently active tab. Use when controlled.
defaultValueValue0The initial active tab value when uncontrolled.
onValueChange(value, details) => voidCalled when the active tab changes, whether by click, keyboard, or an automatic fallback.
orientation"horizontal" | "vertical""horizontal"The layout flow direction of the tab list.
variantTabsVariant"default"The visual style of the tab list and its sliding indicator.

TabsList

PropTypeDefaultDescription
activateOnFocusbooleanfalseActivate a tab as soon as it receives keyboard focus, instead of requiring Enter or Space.
loopFocusbooleantrueLoop keyboard focus back to the first tab when the end of the list is reached.

TabsTrigger

PropTypeDefaultDescription
valueValuerequiredThe value associated with this tab.
disabledbooleanfalsePrevents interaction and excludes the tab from keyboard navigation.

TabsContent

PropTypeDefaultDescription
valueValuerequiredShown when the Tab with the matching value is active.
keepMountedbooleanfalseKeep the panel mounted in the DOM while hidden, instead of unmounting it.