Fluid Tabs Component

A Base UI tab selector where one active surface travels between tabs, giving selection a clear sense of spatial continuity.

Features

  • Capsule and restrained underline variants.
  • Controlled and uncontrolled state with Base UI keyboard semantics.
  • Interruptible pointer motion with instant keyboard and reduced-motion updates.
  • Horizontal overflow handling that keeps the active tab visible.
  • Semantic --fluid-tabs-* tokens for consumer theme customization.

Playground

Try the capsule and underline treatments, switch the active tab, and compare the motion behavior.

Controls
Controls

Installation

Usage

Props

PropertyTypeDefaultDescription
tabsFluidTabItem[]requiredTabs displayed in the horizontal tab list.
valuestringControlled active tab value.
defaultValuestringInitially active tab for uncontrolled usage.
onValueChange(value: string) => voidCalled when the active tab changes.
variant"capsule" | "underline""capsule"Visual treatment for the active surface.
size"sm" | "md" | "lg""md"Size of the tab triggers.
ariaLabelstring"Tabs"Accessible label for the tab list.
activeIndicatorClassNamestringCapsule uses the active surface token; underline uses foreground.Styling hook for the active surface.
hoverClassNamestring"bg-[var(--fluid-tabs-hover)]"Optional styling hook for the supporting hover cue.
classNamestringAdditional classes for the root container.
listClassNamestringAdditional classes for the tab list.