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@next 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>

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.

Live playground

Edit the component props and inspect the exact JSX before copying it. The preview loads only when this section enters the viewport.

Generated JSX
<Tabs
  defaultValue="overview"
  orientation="horizontal"
>
  <TabsList>
    <TabsTrigger
      value="overview"
    >Overview</TabsTrigger>
    <TabsTrigger
      value="activity"
    >Activity</TabsTrigger>
  </TabsList>
  <TabsContent
    value="overview"
    className="rounded-md border p-4 text-sm"
  >68 components now have live playgrounds.</TabsContent>
  <TabsContent
    value="activity"
    className="rounded-md border p-4 text-sm"
  >The latest quality gates are green.</TabsContent>
</Tabs>

API reference

Generated from the public TypeScript exports in src/ui/tabs.tsx.

View JSON

Tabs

Component
Props: React.ComponentProps<typeof TabsPrimitive.Root>

TabsList

Component
Props: React.ComponentProps<typeof TabsPrimitive.List>

TabsTrigger

Component
Props: React.ComponentProps<typeof TabsPrimitive.Trigger>

TabsContent

Component
Props: React.ComponentProps<typeof TabsPrimitive.Content>

Accessibility contract

Machine-readable behavior and consumer responsibilities for tabs.

View JSON
Support
Primitive-managed
Pattern
tabs
Radix Tabs
Keyboard interactions for tabs
KeysBehavior
ArrowLeft ArrowRight Home EndMove focus and selection between tabs according to orientation.
TabMove from the active tab into its tabpanel.

Built-in semantics

  • Manages tablist, tab and tabpanel roles plus aria-selected/controls linkage.

Consumer responsibilities

  • Give every trigger a concise label and keep each panel associated with one trigger.