Tabs
One view at a time — arrow keys move between tabs (Radix Tabs).
Preview
Zostel Manali
Walk the deodar woods to Hadimba. Then go higher.
WALK
CLIMB
RISE
Usage
tsx
import { Tabs, TabsList, TabsTrigger, TabsContent } from "zostel-ui";
<Tabs defaultValue="overview">
<TabsList>
<TabsTrigger value="overview">Overview</TabsTrigger>
<TabsTrigger value="rooms">Rooms</TabsTrigger>
</TabsList>
<TabsContent value="overview">…</TabsContent>
<TabsContent value="rooms">…</TabsContent>
</Tabs>
{/* the same skin for something that isn't a tab (SectionNav's links): the classes, never a copy; the one on show is data-state="active" */}
<ul className={cn(tabsListClassName, "gap-1")}>
<li><a href="#stays" data-state="active" aria-current="true" className={tabsTriggerClassName}>Stays</a></li>
</ul>Tabs
| Prop | Type | Default | Description |
|---|---|---|---|
value / defaultValue | string | — | The open tab. |
onValueChange | (value: string) => void | — | Called when it changes. |
orientation | "horizontal" | "vertical" | "horizontal" | Which arrow keys move. |
tabsListClassName · tabsTriggerClassName | string | — | The segmented skin, exported: the well, and a segment (the one on show, data-state="active", is the card’s colours with an inset line in muted-foreground, which clears 3:1 by day and at night). |
value / defaultValueType:
stringDefault: —
The open tab.
onValueChangeType:
(value: string) => voidDefault: —
Called when it changes.
orientationType:
"horizontal" | "vertical"Default:
"horizontal"Which arrow keys move.
tabsListClassName · tabsTriggerClassNameType:
stringDefault: —
The segmented skin, exported: the well, and a segment (the one on show, data-state="active", is the card’s colours with an inset line in muted-foreground, which clears 3:1 by day and at night).