docs / core / tabs

Tabs

one panel at a time, picked from a row of peer tabs. the active tab takes a single indicator, a pill or a hairline, never both.

intensity · recedesrsc · client

provenance

authored in usva

layer

core / primitives

intensity

recedes · safe anywhere, including dense surfaces

composition

settings and detail views where sections are true peersvertical orientation for a settings rail beside its panelsnot navigation between pages. tabs never change the urlnot for sequential steps. a wizard has order, tabs do not

a11y

real tab / tabpanel roles · one tab stop into the list, arrows rove and activate · disabled tabs stay visible at 50%jest-axe

dependencies

@base-ui/react
live demo · try it out
Manage your account details.
customize
variantpill surface or hairline underline
orientationrow of tabs or a side rail
activateOnFocusarrows switch panels as focus moves
disabledTabthe team tab stays visible at 50%
usagecopy
import { Tabs } from "@usva-ui/react/primitives/tabs";

<Tabs defaultValue="account">
  <Tabs.List>
    <Tabs.Tab value="account">Account</Tabs.Tab>
    <Tabs.Tab value="password">Password</Tabs.Tab>
    <Tabs.Tab value="team">Team</Tabs.Tab>
  </Tabs.List>
  <Tabs.Panel value="account">Manage your account details.</Tabs.Panel>
  <Tabs.Panel value="password">Change your password.</Tabs.Panel>
  <Tabs.Panel value="team">Invite and manage teammates.</Tabs.Panel>
</Tabs>

Tabs

proptypedefaultnotes
valueValue | nullcontrolled active tab.
defaultValueValue | nullinitial active tab when uncontrolled.
onValueChange(value, eventDetails) => voidfires when the active tab changes.
orientation"horizontal" | "vertical""horizontal"vertical stacks the list and moves the indicator to its edge.

Tabs.List

proptypedefaultnotes
variant"pill" | "underline""pill"pill slides a raised surface behind the tab; underline slides a hairline along the list edge.
activateOnFocusbooleantruearrow keys switch panels as focus moves, not on a second Enter.

get it

bun add @usva-ui/reactcopy
usagecopy
import { Tabs } from "@usva-ui/react/primitives/tabs";

<Tabs defaultValue="account">
  <Tabs.List>
    <Tabs.Tab value="account">Account</Tabs.Tab>
    <Tabs.Tab value="password">Password</Tabs.Tab>
  </Tabs.List>
  <Tabs.Panel value="account">Manage your account details.</Tabs.Panel>
  <Tabs.Panel value="password">Change your password.</Tabs.Panel>
</Tabs>