MindeesUI
ComponentsNavigation

Tabs

Headless, controlled-or-uncontrolled tabs with TabList, Tab, and TabPanel parts for switching between views.

Tabs is a compound component family. The root holds the active value and exposes it through context, while TabList, Tab, and TabPanel consume it. It works controlled (via value and onValueChange) or uncontrolled (via defaultValue).

Import

import { Tabs, TabList, Tab, TabPanel } from '@mindees/ui';

Usage

<Tabs defaultValue="overview">
  <TabList>
    <Tab value="overview">Overview</Tab>
    <Tab value="activity">Activity</Tab>
    <Tab value="settings" disabled>
      Settings
    </Tab>
  </TabList>
  <TabPanel value="overview">
    <Text>Overview content</Text>
  </TabPanel>
  <TabPanel value="activity">
    <Text>Activity content</Text>
  </TabPanel>
  <TabPanel value="settings">
    <Text>Settings content</Text>
  </TabPanel>
</Tabs>

Props

Tabs

PropTypeDefaultDescription
valuestringControlled active tab value.
defaultValuestring''Initial active value when uncontrolled.
onValueChange(next: string) => voidFired whenever the active tab changes.
childrenReactNodeTab parts (TabList, TabPanel).

TabList

PropTypeDefaultDescription
scrollablebooleanfalseRender inside a horizontal ScrollView for overflow.
childrenReactNodeOne or more Tab elements.

Tab

PropTypeDefaultDescription
valuestringIdentifier matched against the active Tabs value.
childrenReactNodeLabel content rendered inside the tab.
disabledbooleanfalsePrevents activation and dims the tab.

TabPanel

PropTypeDefaultDescription
valuestringRenders children only when this matches the active tab.
childrenReactNodePanel content.

Accessibility

The non-scrollable TabList uses accessibilityRole="tablist". Each Tab is accessibilityRole="tab" with accessibilityState={{ selected, disabled }} so screen readers announce the active state. Disabled tabs ignore press events. On the web target, native focus order follows DOM order.

On this page