Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
React Native docs
NavigationReact Native

Tabs

Switch a controlled native content panel from an accessible tab list.

Public APILumenTabsReact Native

Native example

Use Tabs

Use for two to five peer content views whose panel changes in place. Keep URL history and nested destination navigation in the application router; use Navigation bar for top-level app destinations.

Tabs rendered in the Expo web renderer Lumen playground

Captured exampleExpo web renderer

Open interactive preview
Open the Tabs demo
tsx
import { useState } from 'react'
import { LumenTabs, LumenText } from '@santi020k/lumen-react-native'

const views = [
  { label: 'Overview', value: 'overview' },
  { label: 'Activity', value: 'activity' }
]

const panels: Record<string, string> = {
  activity: 'Atlas 2.4 shipped this week.',
  overview: '4 active projects and 12 members.'
}

export function WorkspaceTabs() {
  const [view, setView] = useState('overview')

  return (
    <LumenTabs label="Workspace views" onValueChange={setView} options={views} value={view}>
      <LumenText>{panels[view]}</LumenText>
    </LumenTabs>
  )
}
Basic
Children render the panel for the selected value only.
Disabled tab
Disable a tab the person cannot open yet instead of hiding it.

Reference

Public API

The primary shared and platform-specific options exposed by LumenTabs.

APIValues or typeDefaultDescription
labelStringRequiredNames the tab list for assistive technology.
panelAccessibilityLabelString?Selected tab labelNames the active panel using application-localized text without appending an English role description.
optionsreadonly LumenSelectionOption[]RequiredProvides stable tab values, short labels, and optional disabled state.
valuestringRequiredStores the active tab.
onValueChange(string) => voidRequiredUpdates controlled tab selection.
childrenNative content viewRequiredRenders the active panel while Lumen owns the tab list and panel relationship.

Native behavior

Design and accessibility

When to use it

Use for two to five peer content views whose panel changes in place. Keep URL history and nested destination navigation in the application router; use Navigation bar for top-level app destinations.

Accessibility

Every tab exposes selected and disabled state, the tab list has a readable name, and the active panel is announced when selection changes.

Shared component

Available on other platforms

Apple / SwiftUIAndroid / Compose Web
React Native docsNative primitives