Navigation & Menus
@hacline/ui/tabsTabs
Switch between related content panels.
Usage
Click a tab or use the arrow keys to switch content. Pass the same value to TabsTab and TabsPanel to connect them.
Design handoff is scheduled for this week.
"use client";
import {
Tabs,
TabsIndicator,
TabsList,
TabsPanel,
TabsTab,
} from "@/components/ui/hacline/components/tabs";
export const Example = () => (
<Tabs className="max-w-sm" defaultValue="overview">
<TabsList aria-label="Project details">
<TabsIndicator />
<TabsTab value="overview">Overview</TabsTab>
<TabsTab value="activity">Activity</TabsTab>
<TabsTab value="members">Members</TabsTab>
</TabsList>
<TabsPanel value="overview">
Design handoff is scheduled for this week.
</TabsPanel>
<TabsPanel value="activity">Latest edit by the docs lead.</TabsPanel>
<TabsPanel value="members">4 collaborators on this project.</TabsPanel>
</Tabs>
);Manually Activated Vertical Tabs
The Up and Down arrow keys move focus only; press Enter or Space to switch the active panel.
Showing 32 records.
"use client";
import {
Tabs,
TabsList,
TabsPanel,
TabsTab,
} from "@/components/ui/hacline/components/tabs";
export const Example = () => (
<Tabs
activation="manual"
className="max-w-xs"
defaultValue="source"
orientation="vertical"
>
<TabsList aria-label="Data view mode" className="shrink-0 self-start">
<TabsTab value="source">Raw data</TabsTab>
<TabsTab value="report">Summary report</TabsTab>
</TabsList>
<TabsPanel value="source">Showing 32 records.</TabsPanel>
<TabsPanel value="report">Grouped by department.</TabsPanel>
</Tabs>
);Parts
| Part | Description | Extended Props |
|---|---|---|
TabsIndicator | Marks the selected tab. Its box comes from the --active-tab-* variables, measured from the tab list. | — |
TabsList | The row of tabs, a tablist with one tab stop and arrow keys between its tabs. | variant |
TabsPanel | The content of the tab with the same value, shown while that tab is selected. | — |
TabsTab | A tab. Selecting it shows the panel with the same value. | size |
TabsTabIcon | An icon inside a tab. A tab with only an icon needs an aria-label. Screen readers skip it, and mirror flips it in right-to-left text. | — |
Props
Prop
Type