Componentnavigation1.63 KB gzipZero dependencies
Tabs
Segmented panel switch with roving keyboard focus.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add tabsOr install the full npm package:
npm install bigbulluiUsage
tsx10 lines
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; <Tabs defaultValue="one"> <TabsList> <TabsTrigger value="one">One</TabsTrigger> <TabsTrigger value="two">Two</TabsTrigger> </TabsList> <TabsContent value="one">First.</TabsContent> <TabsContent value="two">Second.</TabsContent></Tabs>Source code
tabs.tsx + 3 helpersZero third-party dependencies (4 local files shown in tabs below).
tsxtabs.tsx244 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils";import { useDirection, type Direction } from "./lib/direction";import { inertProp } from "./lib/react-compat"; type TabsContextValue = { value: string; activeTabStop?: string; setValue: (v: string) => void; baseId: string; animated: boolean; orientation: "horizontal" | "vertical"; activationMode: "automatic" | "manual"; dir: Direction;};const TabsCtx = React.createContext<TabsContextValue | null>(null);Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { Tabs } from "@/components/ui/tabs"; <Tabs />| Prop | Type | Description |
|---|---|---|
| value | string | Controlled active tab value. |
| defaultValue | string | Initially active tab value. |
| onValueChange | (value: string) => void | Called when active tab changes. |
| orientation | "horizontal" | "vertical" | Layout and keyboard navigation axis. (Default: "horizontal") |
| activationMode | "automatic" | "manual" | Configures activation mode. (Default: "automatic") |
| dir | Direction | Explicit reading direction override (ltr or rtl). |
| animated | boolean | Dual-mode: false renders instantly with no motion. Default true. |