Skip to content

Commit 40451d0

Browse files
committed
Document how to show search bar on the tab bar
1 parent a06297c commit 40451d0

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed
3.66 MB
Binary file not shown.
716 KB
Binary file not shown.

versioned_docs/version-7.x/native-bottom-tab-navigator.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,27 @@ Uses iOS built-in tab bar items with standard iOS styling and localized titles.
122122
- `search`
123123
- `topRated`
124124

125-
If set to `search`, the tab is positioned as a separate item on the tab bar on iOS 26+.
125+
The [`tabBarIcon`](#tabbaricon) and [`tabBarLabel`](#tabbarlabel) options will override the icon and label from the system item. If you want to keep the system behavior on iOS, but need to provide icon and label for other platforms, use `Platform.OS` or `Platform.select` to conditionally set `undefined` for `tabBarIcon` and `tabBarLabel` on iOS.
126126

127-
For the `search` item, when the tab is selected, the tab bar transforms into a search field if the screen in the tab navigator or a nested [native stack navigator](native-stack-navigator.md) has [`headerSearchBarOptions`](native-stack-navigator.md#headersearchbaroptions) configured and the native header is shown with [`headerShown: true`](native-stack-navigator.md#headershown). This won't work if a custom header is provided with the `header` option.
127+
##### Search tab on iOS 26+
128128

129-
The [`tabBarIcon`](#tabbaricon) and [`tabBarLabel`](#tabbarlabel) options will override the icon and label from the system item. If you want to keep the system behavior on iOS, but need to provide icon and label for other platforms, use `Platform.OS` or `Platform.select` to conditionally set `undefined` for `tabBarIcon` and `tabBarLabel` on iOS.
129+
The `tabBarSystemItem` option has special styling and behavior when set to `search` on iOS 26+.
130+
131+
Additionally, when the `search` tab is selected, the tab bar transforms into a search field if the screen in the tab navigator or a nested [native stack navigator](native-stack-navigator.md) has [`headerSearchBarOptions`](native-stack-navigator.md#headersearchbaroptions) configured and the native header is shown with [`headerShown: true`](native-stack-navigator.md#headershown). This won't work if a custom header is provided with the `header` option.
132+
133+
Example:
134+
135+
```js
136+
tabBarSystemItem: 'search',
137+
headerShown: true,
138+
headerSearchBarOptions: {
139+
placeholder: 'Search',
140+
},
141+
```
142+
143+
<video playsInline autoPlay muted loop>
144+
<source src="/assets/7.x/native-bottom-tabs-ios-search.mp4" />
145+
</video>
130146

131147
#### `tabBarLabel`
132148

@@ -357,6 +373,10 @@ The minimize behavior for the tab bar. Supported values:
357373

358374
Only supported on iOS 26 and above.
359375

376+
<video playsInline autoPlay muted loop>
377+
<source src="/assets/7.x/native-bottom-tabs-ios-minimize.mp4" />
378+
</video>
379+
360380
#### `lazy`
361381

362382
Whether this screen should render only after the first time it's accessed. Defaults to `true`. Set it to `false` if you want to render the screen on the initial render of the navigator.

0 commit comments

Comments
 (0)