"use client";
import { Tabs } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
items (required) | readonly TabItem<Value>[] | — | Items to render. |
defaultValue | Value | the first enabled tab | Selected tab id when uncontrolled (default: the first enabled tab). |
activationMode | "automatic" | "manual" | automatic | automatic (default): arrow keys select the focused tab. manual: arrow keys only move focus; Enter/Space selects. |
keepMounted | boolean | — | Keep every panel mounted (inactive ones hidden), so their state — form input, scroll position — survives switching tabs. Default false. |
listProps | HTMLAttributes<HTMLDivElement> | — | Props for the role="tablist" element (aria-label/aria-labelledby on Tabs go there too). |
onValueChange | (id: Value) => void | — | Called with the new value (only when it changes). |
orientation | "horizontal" | "vertical" | — | Layout and arrow-key axis. |
value | Value | — | Selected tab id (controlled). |
itemsrequiredreadonly TabItem<Value>[]
Items to render.
defaultValuedefault the first enabled tabValue
Selected tab id when uncontrolled (default: the first enabled tab).
activationModedefault automatic"automatic" | "manual"
automatic (default): arrow keys select the focused tab. manual: arrow keys only move focus; Enter/Space selects.
keepMountedboolean
Keep every panel mounted (inactive ones hidden), so their state — form input, scroll position — survives switching tabs. Default false.
listPropsHTMLAttributes<HTMLDivElement>
Props for the role="tablist" element (aria-label/aria-labelledby on Tabs go there too).
onValueChange(id: Value) => void
Called with the new value (only when it changes).
orientation"horizontal" | "vertical"
Layout and arrow-key axis.
valueValue
Selected tab id (controlled).
Other props are passed to the root element (HTMLAttributes<HTMLDivElement>), including className, style, id and aria-* attributes.
const items = [
{ id: "one", label: "One", panel: "First panel" },
{ id: "two", label: "Two", panel: "Second panel" },
];
<Tabs defaultValue="one" items={items} />