Tabs

A Base UI Tabs family for switching related panels with default, underline, and opt-in sortable list treatments.

Preview#

Overview content
Controls
import { Tabs, TabsList, TabsPanel, TabsTab } from "raft-ui";

<Tabs defaultValue="overview">
  <TabsList>
    <TabsTab value="overview" />
  </TabsList>
  <TabsPanel value="overview" />
</Tabs>

Variants#

Overview
Overview

Placement#

placement puts the tab list on any side of the panels. left and right stack the tabs vertically and switch keyboard navigation to the up and down arrows; the underline indicator always sits on the side that faces the panels.

Name, topic, and description of #design-review.
Name, topic, and description of #design-review.
Name, topic, and description of #design-review.
Name, topic, and description of #design-review.

Icons#

Overview
Messages

Reorderable#

API#WIP

placementdefault: "top"
"top" | "bottom" | "left" | "right"
Side of the panels the tab list sits on. left and right stack the tabs vertically and default orientation to vertical.
value
T
Controlled active tab value.
defaultValue
T
Initial active tab value for uncontrolled use.
onValueChange
(value: T, eventDetails) => void
Called when Base UI changes the active tab.
...props
BaseTabs.Root.Props
Base UI Tabs root props for orientation and other root behavior.
variantdefault: "default"
"default" | "underline"
Visual treatment for the tab list. Defaults to the chip-style default variant.
...props
BaseTabs.List.Props
Tab list container. Compose TabsTab as children.
value
T
The tab value passed to Base UI.
...props
BaseTabs.Tab.Props
Tab trigger. Compose icon and TabsLabel as children.
...props
ComponentPropsWithRef<"span">
Optional text slot for icon-and-label tab layouts.
value
T
Associates the panel with its matching TabsTab value.
...props
BaseTabs.Panel.Props
Panel content associated with a tab value.
value
readonly T[]
Current tab order.
onReorder
(value: T[]) => void
Receives the new order after drag end.
variantdefault: "default"
"default" | "underline"
Visual treatment inherited by the underlying TabsList.
...props
TabsListProps
Sortable TabsList wrapper. Compose SortableTabsTab as children.
value
T
A sortable tab value passed to Base UI and dnd-kit.
...props
TabsTabProps
Draggable tab trigger used inside SortableTabsList.
items
readonly OrderedTabItem[]
Canonical tab definitions keyed by id.
storedOrder
readonly string[]
Persisted order to reconcile against items; unknown ids are dropped.