Tabs

Base UI

Related views, one at a time, with an accessible tab and panel relationship.

Your workspace at a glance.
ReadyResponsive

Usage

Package export
tsx
import { 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

PropType / descriptionDefault
defaultValuestring | number

Initial active tab for uncontrolled usage.

-
valuestring | number

Active tab for controlled usage.

-
onValueChangefunction

Called 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.