Skip to content

Commit 23f6b68

Browse files
committed
Document tabBarVariant
1 parent 201f234 commit 23f6b68

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed
-30 KB
Loading
70.4 KB
Loading
-6.53 KB
Loading

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

+18-6
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ When the tab bar is positioned on the `left` or `right`, it is styled as a sideb
404404
```js
405405
const Tabs = createBottomTabNavigator({
406406
screenOptions: {
407-
tabBarPosition: dimensions.width < 600 ? 'bottom' : 'left',
407+
tabBarPosition: isLargeScreen ? 'left' ? 'bottom',
408408
},
409409

410410
// ...
@@ -417,7 +417,7 @@ const Tabs = createBottomTabNavigator({
417417
```js
418418
<Tab.Navigator
419419
screenOptions={{
420-
tabBarPosition: dimensions.width < 600 ? 'bottom' : 'left',
420+
tabBarPosition: isLargeScreen ? 'left' ? 'bottom',
421421
}}
422422
>
423423
```
@@ -427,15 +427,16 @@ const Tabs = createBottomTabNavigator({
427427
428428
<img src="/assets/7.x/bottom-tabs-side.png" alt="Sidebar" data-landscape></img>
429429
430-
You can also render a compact sidebar by placing the label below the icon:
430+
You can also render a compact sidebar by placing the label below the icon. This is only supported when the [`tabBarVariant`](#tabbarvariant) is set to `material`:
431431
432432
<Tabs groupId="config" queryString="config">
433433
<TabItem value="static" label="Static" default>
434434
435435
```js
436436
const Tabs = createBottomTabNavigator({
437437
screenOptions: {
438-
tabBarPosition: dimensions.width < 600 ? 'bottom' : 'left',
438+
tabBarPosition: isLargeScreen ? 'left' ? 'bottom',
439+
tabBarVariant: isLargeScreen ? 'material' : 'uikit',
439440
tabBarLabelPosition: 'below-icon',
440441
},
441442

@@ -458,11 +459,22 @@ const Tabs = createBottomTabNavigator({
458459
</TabItem>
459460
</Tabs>
460461
461-
![Sidebar](/assets/7.x/bottom-tabs-side-compact.png)
462+
![Compact sidebar](/assets/7.x/bottom-tabs-side-compact.png)
463+
464+
#### `tabBarVariant`
465+
466+
Variant of the tab bar. Available values are:
467+
468+
- `uikit` (Default) - The tab bar will be styled according to the iOS UIKit guidelines.
469+
- `material` - The tab bar will be styled according to the Material Design guidelines.
470+
471+
The `material` variant is currently only supported when the [`tabBarPosition`](#tabbarposition) is set to `left` or `right`.
472+
473+
![Material sidebar](/assets/7.x/bottom-tabs-side-material.png)
462474
463475
#### `lazy`
464476
465-
Whether this screens should render the first time it's accessed. Defaults to `true`. Set it to `false` if you want to render the screen on initial render.
477+
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.
466478
467479
#### `freezeOnBlur`
468480

0 commit comments

Comments
 (0)