Skip to content
Logic2BUI

Search docs

Search components and documentation

New
Menu

Tabs

A set of layered sections of content, only one of which is displayed at a time.

Installation

npx logic2b@latest add tabs

Usage

import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"

<Tabs defaultValue="account">
  <TabsList>
    <TabsTrigger value="account">Account</TabsTrigger>
    <TabsTrigger value="password">Password</TabsTrigger>
  </TabsList>
  <TabsContent value="account">Account settings.</TabsContent>
  <TabsContent value="password">Password settings.</TabsContent>
</Tabs>

API

Prop Type Default
defaultValue (Tabs) string
value / onValueChange (Tabs) string / (value: string) => void
orientation (Tabs) horizontal | vertical horizontal
value (TabsTrigger / TabsContent) string — links a trigger to its panel
disabled (TabsTrigger) boolean false

Examples

With icons

View your activity at a glance.

Disabled tab

Items you are currently working on.

Accessibility

  • Follows the WAI-ARIA tabs pattern: Tab moves focus into the active trigger, then Arrow keys move between triggers.
  • Home / End jump to the first / last trigger; disabled triggers are skipped.
  • Each TabsContent is exposed as a tabpanel labelled by its trigger, so the relationship is announced.