React Native · Components
Tabs
Switches between views in the same area.
4 exports
Live example
The preview runs in the browser with the web component; the native component takes the same props and looks the same on iOS and Android.
Preview
General settings go here.
Notifications settings go here.
Security settings go here.
Code
Events
- Events appear here when you interact with the preview.
Import
Tabs
componentSwitches between views in the same area. If the tabs do not fit, the list scrolls horizontally and the selected tab is brought into view; in the line style the underline slides to the selected tab on the native driver. Previously opened panels stay in the tree (their state is kept).
Examples
TabItem
interfaceA tab inside Tabs.
| Name | Type | Description |
|---|---|---|
value | string | Unique value. |
label | ReactNode | Tab text. |
icon? | IconProp | Icon before the text. |
badge? | ReactNode | Small content after the text (e.g. <Badge>3</Badge>). |
content? | ReactNode | Panel shown while the tab is selected. |
disabled? | boolean | Cannot be selected. |
TabsVariant
typeTab style: pill a pill on a muted background, line an underline.
TabsProps
interfaceTabs props.
| Name | Type | Default | Description |
|---|---|---|---|
ref? | Ref<ViewRef> | Ref of the underlying native element. | |
items | readonly TabItem[] | Tabs. | |
value? | string | Selected tab (controlled). | |
defaultValue? | string | the first enabled tab | Initially selected tab. |
onValueChange? | (value: string) => void | When the selection changes. | |
orientation? | "horizontal" | "vertical" | "horizontal" | Tab layout. |
variant? | TabsVariant | (string & {}) | "pill" | Style: one of the built-in styles or a name added via appearance.variants.tabs (applied to the tab list). |
effect? | EffectProp | Effect of the tabs ("ripple", "glow"…); stays on for the selected tab like active. Defaults to appearance.defaults.tabs.effect. See BuiltinEffect. | |
fullWidth? | boolean | Tabs share the row equally (no scrolling). | |
label? | string | Screen reader name of the tab list. | |
style? | StyleProp<ViewStyle> | Container style. |