Component

Tabs

A set of layered sections of content with Neo-Brutalism styling. Built on Radix UI Tabs primitive.

Preview

Manage your account settings and preferences here.

Installation

pnpm dlx brutx@latest add tabs

Usage

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

<Tabs defaultValue="tab1">
  <TabsList>
    <TabsTrigger value="tab1">Tab 1</TabsTrigger>
    <TabsTrigger value="tab2">Tab 2</TabsTrigger>
  </TabsList>
  <TabsContent value="tab1">
    Content for tab 1
  </TabsContent>
  <TabsContent value="tab2">
    Content for tab 2
  </TabsContent>
</Tabs>

Examples

Controlled Tabs

Control tab state with value and onValueChange.

Account settings panel

With Disabled Tab

Use disabled prop to disable specific tabs.

Project overview and summary.

With Form Content

Tabs containing form inputs.

Full Width Tabs

Make tabs stretch to fill the container width.

Content for the first tab.

API Reference

Tabs

Root component that manages tab state.

PropTypeDefaultDescription
defaultValuestring-Initial active tab (uncontrolled)
valuestring-Controlled active tab value
onValueChange(value: string) => void-Callback when tab changes
orientation"horizontal" | "vertical""horizontal"Tab orientation

TabsTrigger

Individual tab button.

PropTypeDefaultDescription
valuestringrequiredUnique identifier for the tab
disabledbooleanfalseDisable this tab

TabsContent

Content panel for a tab.

PropTypeDefaultDescription
valuestringrequiredMust match a TabsTrigger value
forceMountbooleanfalseKeep content mounted even when inactive

All Exports

ComponentDescription
TabsRoot container
TabsListContainer for tab triggers
TabsTriggerIndividual tab button
TabsContentTab content panel

Accessibility

  • Tab moves focus to the active tab
  • navigate between tabs (horizontal)
  • navigate between tabs (vertical)
  • Home / End move to first/last tab
  • Enter / Space activates focused tab