Tabs show one panel at a time, chosen from a row of tabs that the arrow keys move along, built on Radix Tabs with Material Design 3 styling.

pnpm add @behivetech/atoms.tabs

This is the snapshot of v0.1.1, the current version, as recorded on 2026-11-10. The live page runs its examples →

Tabs show one panel at a time, chosen from a row of tabs that the arrow keys move along, built on Radix Tabs with Material Design 3 styling.

Usage

1import { Tab, TabList, TabPanel, Tabs } from "@behivetech/atoms.tabs";
2
3<Tabs defaultValue="one">
4 <TabList aria-label="Sections">
5 <Tab value="one">One</Tab>
6 <Tab value="two">Two</Tab>
7 </TabList>
8 <TabPanel value="one">First</TabPanel>
9 <TabPanel value="two">Second</TabPanel>
10</Tabs>;

The ```jsx block above runs live on the docs site. Imports are stripped and every registry export is in scope, so you can compose with other components too.

Properties

Tabs props

PropTypeDefaultDescription
asChildboolean——
classNamestring—Additional class names to merge with the component root element
defaultValuestringThe tab selected first when uncontrolled
onValueChange((value: string) => void)—Called with the value of the tab the user selected
valuestring—The selected tab's value when controlled

Also accepts the native attributes of its root element (className, aria-*, event handlers, …).

TabPanel props

PropTypeDefaultDescription
value*string—The `value` of the `Tab` that shows this panel
asChildboolean——
classNamestring—Additional class names to merge with the component root element

Also accepts the native attributes of its root element (className, aria-*, event handlers, …).

Tab props

PropTypeDefaultDescription
value*string—Identifies the tab and the `TabPanel` it shows
asChildboolean——
classNamestring—Additional class names to merge with the component root element

Also accepts the native attributes of its root element (className, aria-*, event handlers, …).

TabList props

PropTypeDefaultDescription
asChildboolean——
classNamestring—Additional class names to merge with the component root element

Also accepts the native attributes of its root element (className, aria-*, event handlers, …).

Hooks

useSelectedTab hook

The value of the selected tab, read by `Tab` to set its `--selected` modifier.

useSelectedTab(): string | undefined

Returns string | undefined