Fluid Tabs

Use Fluid Tabs to switch between related views while keeping the selected surface visually connected. The active capsule or underline moves between items for pointer input and updates immediately for keyboard input.

Preview

Reduce motion:Off
Tune:Off
Inspect

Project overview

A clear view of what is ready and what needs attention.

3 active projects

Installation

Basic usage

TypeScript
settings-tabs.tsx

Examples

Use the capsule variant for compact segmented navigation and the underline variant for editorial navigation. Controlled state works well when the selected view is reflected in the URL.

Usage

API

PropertyTypeDefaultDescription
tabsFluidTabItem[]requiredTabs displayed in the horizontal tab list.
valuestring—Controlled active tab value.
defaultValuestring—Initially active tab for uncontrolled usage.
onValueChange(value: string) => void—Called 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.
classNamestring—Additional classes for the root container.
listClassNamestring—Additional classes for the tab list.

Accessibility

Fluid Tabs uses Base UI tab semantics and keyboard navigation. Horizontal overflow keeps the active item available in narrow containers.

Styling

The fluid-tabs token set controls the surface and indicator treatment. Reduced-motion preferences keep selection feedback without the travelling transition.

Contact

Found a bug or need help using this component? Open an issue on GitHub.

License & Usage

Sona UI is available under the MIT license. You may use, modify, and distribute this component in personal and commercial projects.

Was this page helpful?

Your response helps us improve component docs.

Related components