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)
Prop | Type | Default | Description |
---|---|---|---|
defaultValue | string | "" | Default active tab value |
value | string | "" | Controlled active tab value |
onValueChange | (value: string) => void | undefined | Callback when tab changes |
className | string | "" | Additional CSS classes |
TabsList
Prop | Type | Default | Description |
---|---|---|---|
variant | "default" | "pills" | "underlined" | "default" | Visual style variant |
size | "sm" | "md" | "lg" | "sm" | Size of the tabs (32px, 40px, 48px heights) |
showHoverEffect | boolean | true | Whether to show hover indicator |
showActiveIndicator | boolean | true | Whether to show active indicator |
activeIndicatorPosition | "top" | "bottom" | "bottom" | Position of active indicator |
activeIndicatorOffset | number | 0 | Offset for active indicator |
stretch | boolean | false | Whether tabs should stretch to fill width |
showBottomBorder | boolean | false | Whether to show bottom border |
ariaLabel | string | "Tabs" | Accessibility label |
className | string | "" | Additional CSS classes |
TabsTrigger
Prop | Type | Default | Description |
---|---|---|---|
value | string | - | Unique value for this tab (required) |
disabled | boolean | false | Whether the tab is disabled |
label | string | undefined | Label text (alternative to children) |
activeClassName | string | "" | CSS classes when tab is active |
inactiveClassName | string | "" | CSS classes when tab is inactive |
disabledClassName | string | "" | CSS classes when tab is disabled |
className | string | "" | Additional CSS classes |
TabsContent
Prop | Type | Default | Description |
---|---|---|---|
value | string | - | Value that matches the corresponding trigger (required) |
className | string | "" | 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.
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.