Tabs

A set of layered sections of content—known as tab panels—that are displayed one at a time.

Usage

import { Tabs } from "@smartacteam/react-native-ui";
<Tabs.List onChange={setTab} value={tab}>
  <Tabs.Item label='Account' value={'account'}/>
  <Tabs.Item label='User' value={'user'}/>
  <Tabs.Item selected label='Password' value={'password'}/>
</Tabs.List>

Default and Squared

Preview

Props

Tabs.List

NameTypeRequiredDescription
childrenReact.ReactElement<ItemProps>[]YesAn array of Tabs.Item elements. Each child represents a selectable tab.
valueanyYesCurrently selected tab value.
onChange(value: Value) => voidYesCallback fired when a different tab is selected.
radius_*RadiusNoBorder radius overrides, e.g. radius_md, radius_full.
(…)(Inherited)Props from BaseSmacStyling, ViewProps.

Tabs.Item

NameTypeRequiredDescription
labelstringYesText label of the tab.
valueanyYesValue representing the tab. Used for selection logic.
selectedbooleanNoWhether the tab is currently selected.
onSelect(value: Value) => voidNoCallback to select the tab. Automatically passed from Tabs.List.
(…)(Inherited)Props from BaseSmacStyling, TouchableOpacityProps.