Tabs

PreviousNext

Navigation-only tabs where the parent controls content visibility based on the selected tab.

The parent component manages content visibility based on the selected tab. Use Tabs Container when navigation and content are co-located.

Basic Usage

Overview

This is the overview content. The parent component controls what's visible based on the selected tab.

With Icons and Badges

Profile settings content

Separated Navigation

Place the tab bar and content in different locations, such as a sidebar.

Home content

Line Variant

Code editor

Conditional Visibility

View-only content

Admin tab is hidden (requires admin permission)

Drag-and-Drop Reordering

Content for first (drag tabs to reorder)

Props

PropTypeDefaultDescription
tabsTabOption[]RequiredArray of tab options
valuestring | number-Current selected tab (controlled)
defaultValuestring | numberFirst tab IDInitially active tab (uncontrolled)
onValueChange(value: string | number) => void-Callback when selected tab changes
onTabsReorder(tabs: TabOption[]) => void-Callback when tabs are reordered
variant"default" | "line""default"Tab trigger style
orientation"horizontal" | "vertical""horizontal"Tab list orientation
draggablebooleanfalseEnable drag-and-drop reordering
showSeparatorsbooleanfalseShow separators between tabs
as"nav" | "div""div"HTML element (use "nav" for site navigation)
classNamestring-Additional CSS classes

TabOption Interface

PropertyTypeDescription
idstring | numberUnique identifier
labelstringDisplay text
iconReact.ReactNodeOptional icon (before label)
badgestring | numberOptional badge count or text
disabledbooleanDisable tab interaction and drag
visibleboolean | ((tab: TabOption, allTabs: TabOption[]) => boolean)Visibility condition
ariaLabelstringCustom ARIA label