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, TabsBackground, TabsList, TabsPanel, TabsTab } from "raft-ui";

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

Variants#

Overview
Overview
Overview
Overview

Icons#

Overview
Messages

Reorderable#

API#WIP

PropTypeDefaultDescription
valueTControlled active tab value.
defaultValueTInitial active tab value for uncontrolled use.
onValueChange(value: T, eventDetails) => voidCalled when Base UI changes the active tab.
...propsBaseTabs.Root.PropsBase UI Tabs root props for orientation and other root behavior.
PropTypeDefaultDescription
variant"default" | "underline""default"Visual treatment for the tab list. Defaults to the chip-style default variant.
...propsBaseTabs.List.PropsTab list container. Compose TabsBackground and TabsTab as children.
PropTypeDefaultDescription
...propsComponentPropsWithRef<"span">Optional visual slot. Place it inside TabsList to render the default container surface or underline top edge.
PropTypeDefaultDescription
valueTThe tab value passed to Base UI.
...propsBaseTabs.Tab.PropsTab trigger. Compose icon and TabsLabel as children.
PropTypeDefaultDescription
...propsComponentPropsWithRef<"span">Optional text slot for icon-and-label tab layouts.
PropTypeDefaultDescription
valueTAssociates the panel with its matching TabsTab value.
...propsBaseTabs.Panel.PropsPanel content associated with a tab value.
PropTypeDefaultDescription
valuereadonly T[]Current tab order.
onReorder(value: T[]) => voidReceives the new order after drag end.
variant"default" | "underline""default"Visual treatment inherited by the underlying TabsList.
...propsTabsListPropsSortable TabsList wrapper. Compose TabsBackground and SortableTabsTab as children.
PropTypeDefaultDescription
valueTA sortable tab value passed to Base UI and dnd-kit.
...propsTabsTabPropsDraggable tab trigger used inside SortableTabsList.
PropTypeDefaultDescription
itemsreadonly OrderedTabItem[]Canonical tab definitions keyed by id.
storedOrderreadonly string[]Persisted order to reconcile against items; unknown ids are dropped.