Tabs
Base UIRelated views, one at a time, with an accessible tab and panel relationship.
ReadyResponsive
Usage
Package exportimport { Tabs, TabsList, TabsTrigger, TabsContent } from "@jnpll/elements-ui/tabs";
<Tabs defaultValue="overview" orientation="horizontal">
<TabsList variant="default">
<TabsTrigger value="overview">{"Overview"}</TabsTrigger>
<TabsTrigger value="activity">Activity</TabsTrigger>
</TabsList>
<TabsContent value="overview">Your workspace at a glance.</TabsContent>
<TabsContent value="activity">Everything is up to date.</TabsContent>
</Tabs>Examples
Line tabs
Your workspace at a glance.
API Reference
| Prop | Type / description | Default |
|---|---|---|
defaultValue | string | numberInitial active tab for uncontrolled usage. | - |
value | string | numberActive tab for controlled usage. | - |
onValueChange | functionCalled when the active tab changes. | - |
orientation | "horizontal" | "vertical"Layout and keyboard navigation direction. | "horizontal" |
TabsList.variant | "default" | "line"Appearance of the tab list. | "default" |
Composition & accessibility
Each TabsTrigger value must match a TabsContent value. Base UI handles focus and arrow-key navigation. TabsList supports default and line variants.