Docs
Tabs
Tabs

A flexible tabs component inspired by Vercel and v0 with smooth animations, keyboard navigation, and accessible design patterns.

Account Settings

Manage your account settings and preferences.

Overview

The Tabs component organizes content into distinct sections with smooth transitions, improving information architecture and reducing cognitive load for users navigating complex interfaces. It provides accessible keyboard navigation and follows modern design patterns, making it essential for dashboards, settings panels, and any multi-section layouts. Perfect for maintaining clean, organized user experiences while maximizing content density.

Installation

pnpm dlx shadcn@latest add https://deltacomponents.dev/r/tabs.json

Usage

"use client"
 
import {
  Tabs,
  TabsContent,
  TabsList,
  TabsTrigger,
} from "@/registry/components/tabs"
 
export function Component() {
  return (
    <Tabs defaultValue="overview" className="w-full">
      <TabsList>
        <TabsTrigger value="overview">Overview</TabsTrigger>
        <TabsTrigger value="analytics">Analytics</TabsTrigger>
        <TabsTrigger value="settings">Settings</TabsTrigger>
      </TabsList>
      <TabsContent value="overview">
        <div className="p-4">
          <h3 className="text-lg font-semibold">Overview</h3>
          <p className="text-muted-foreground">
            Your dashboard overview content.
          </p>
        </div>
      </TabsContent>
      <TabsContent value="analytics">
        <div className="p-4">
          <h3 className="text-lg font-semibold">Analytics</h3>
          <p className="text-muted-foreground">
            Your analytics data and insights.
          </p>
        </div>
      </TabsContent>
      <TabsContent value="settings">
        <div className="p-4">
          <h3 className="text-lg font-semibold">Settings</h3>
          <p className="text-muted-foreground">Configure your preferences.</p>
        </div>
      </TabsContent>
    </Tabs>
  )
}

API Reference

Props

Tabs (Root)

PropTypeDefaultDescription
defaultValuestring""Default active tab value
valuestring""Controlled active tab value
onValueChange(value: string) => voidundefinedCallback when tab changes
classNamestring""Additional CSS classes

TabsList

PropTypeDefaultDescription
variant"default" | "pills" | "underlined""default"Visual style variant
size"sm" | "md" | "lg""sm"Size of the tabs (32px, 40px, 48px heights)
showHoverEffectbooleantrueWhether to show hover indicator
showActiveIndicatorbooleantrueWhether to show active indicator
activeIndicatorPosition"top" | "bottom""bottom"Position of active indicator
activeIndicatorOffsetnumber0Offset for active indicator
stretchbooleanfalseWhether tabs should stretch to fill width
showBottomBorderbooleanfalseWhether to show bottom border
ariaLabelstring"Tabs"Accessibility label
classNamestring""Additional CSS classes

TabsTrigger

PropTypeDefaultDescription
valuestring-Unique value for this tab (required)
disabledbooleanfalseWhether the tab is disabled
labelstringundefinedLabel text (alternative to children)
activeClassNamestring""CSS classes when tab is active
inactiveClassNamestring""CSS classes when tab is inactive
disabledClassNamestring""CSS classes when tab is disabled
classNamestring""Additional CSS classes

TabsContent

PropTypeDefaultDescription
valuestring-Value that matches the corresponding trigger (required)
classNamestring""Additional CSS classes

Examples

Basic Tabs

A simple three-tab interface with overview, analytics, and settings sections.

Account Settings

Manage your account settings and preferences.

Size Variants

Different tab sizes for various interface needs and content density.

Small size tabs content
Medium size tabs content
Large size tabs content

Pills Variant

Modern pill-style tabs with rounded corners and subtle active states, perfect for navigation and settings interfaces.

Pills Variant

Pills with Icons

Complex Layout with Spotify Integration

Advanced tab implementation with rich content and external integrations.

Discover New Music

Find new music based on your listening habits.