Skip to content

Tabs

Tabs

<Tabs defaultSelectedKey="overview">
<TabList aria-label="Sections">
<Tab id="overview">Overview</Tab>
<Tab id="usage">Usage</Tab>
<Tab id="api">API</Tab>
</TabList>
<TabPanel id="overview"></TabPanel>
<TabPanel id="usage"></TabPanel>
<TabPanel id="api"></TabPanel>
</Tabs>

Install: @helixui/core

import { Tabs, TabList, Tab, TabPanel } from '@helixui/core'

status: stable · since: 0.1.0

Tags: sections, switch, in-page

Anatomy

[ Tab ][ Tab ][ Tab* ]
──────────────────────
panel content

Layout

  • displayblock
  • widthfill
  • heightcontent
  • intrinsicSizetab strip + panel; panel sized by content
  • stackablefalse
  • fullBleedfalse

Visual

A horizontal tab strip with an underline indicator under the active tab, followed by the active panel below. Hover/focus tabs lighten with surface tint.

Props

NameTypeDefaultDescription
variant'underline' | 'pill'underlineVisual style. pill reads as a SegmentedControl with panels.
orientation'horizontal' | 'vertical'horizontalLayout.
selectedKeyKeyControlled selection.
defaultSelectedKeyKeyUncontrolled initial.
onSelectionChange(key: Key) => voidChange handler.

Slots

  • Tabs children — TabList + TabPanels
  • TabList children — Tab components
  • Tab children — label
  • TabPanel children — panel content; one per Tab id

Tokens used

color.bg.surface.default, color.bg.action.neutral.default, color.bg.action.brand.default, color.text.primary, color.text.secondary, color.text.action.brand, color.border.default, color.border.focus, radius.md, space.1, space.2, space.3, space.4, font.family.sans, font.size.sm, font.weight.medium, shadow.sm

Accessibility

Role: tablist

Keyboard

KeyAction
ArrowLeftPrevious tab (horizontal).
ArrowRightNext tab (horizontal).
HomeFirst tab.
EndLast tab.

Composes with

ComponentRelationNote
SegmentedControlalternativeSegmentedControl for compact view-mode pickers.
TabchildEach tab.
TabPanelchildEach panel.

Prompt examples

These are the AI prompt → JSX mappings used by the helixui prompt DSL and integrations like Cursor / Claude Code.

in-page sections

“three-tab interface for Overview/Activity/Settings”

<Tabs>
<TabList>
<Tab id="o">Overview</Tab>
<Tab id="a">Activity</Tab>
<Tab id="s">Settings</Tab>
</TabList>
<TabPanel id="o"></TabPanel>
<TabPanel id="a"></TabPanel>
<TabPanel id="s"></TabPanel>
</Tabs>