Skip to content
SevenUI
Sign in
On this page

Tabs

A set of layered sections of content — known as tab panels — that display one panel at a time, built on the Base UI Tabs primitive.

Account
Make changes to your account here. Click save when you're done.

Installation

Bash

Usage

Examples

Line variant

A quick summary of your workspace activity.

With animated indicator

The indicator slides between tabs using the --active-tab-* variables. (Overview)

Composes Tabs.Indicator directly from @base-ui/react/tabs, tracking the active tab via the --active-tab-left/--active-tab-width CSS variables.

API reference

Tabs

Extends the Base UI Tabs Root — all its props apply. Selected-tab styling hooks on data-active (presence); Base UI 1.7 Tabs has no data-selected and no data-state.

PropTypeDefault
value / defaultValuetab value (null deselects all)0 (first tab)
onValueChange(value, eventDetails) => void—
orientation"horizontal" | "vertical""horizontal"

TabsList

PropTypeDefault
variant"default" | "line" — pill or underline style"default"
activateOnFocusboolean — activate on arrow-key focusfalse
loopFocusboolean — arrow keys wraptrue

With the default activateOnFocus: false, arrow keys move focus and Enter/Space activates.

TabsTrigger

Renders a native <button>, but a disabled trigger stays focusable and receives aria-disabled="true" instead of the native disabled attribute — style disabled state with data-disabled:, not the disabled: Tailwind variant.

PropTypeDefault
valuetab value (required)—
disabledbooleanfalse
renderReact.ReactElement — e.g. render={<a href="/account" />}button
nativeButtonboolean — set false when render isn’t a buttontrue

TabsContent

The panel for one tab value; unselected panels are hidden.

PropTypeDefault
valuetab value (required)—
keepMountedboolean — keep inactive panel markup in the DOMfalse

The primitive’s animated Tabs.Indicator (tracking the active tab via --active-tab-left/--active-tab-width CSS variables) is not wrapped — the “animated indicator” example above composes @base-ui/react/tabs directly inside TabsList.

Was this page helpful?