You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Function that given `{ focused: boolean, color: string, size: number }` returns a React.Node, to display in the tab bar.
532
+
Function that given `{ focused: boolean, color: string, size: number }` returns an icon to display in the tab bar. It can be one of the following:
536
533
537
-
With `native` implementation, you can pass an icon object directly instead of a function. A React element is only supported with `custom` implementation.
534
+
- An icon object with both `native` and `custom` implementations
535
+
- A React element with `custom` implementation only
538
536
539
537
It overrides the icon provided by [`tabBarSystemItem`](#tabbarsystemitem) on iOS.
540
538
541
-
The icon can be of following types with `native` implementation:
539
+
The icon object can be one of the following types:
542
540
543
-
- Local image - Supported on iOS and Android
541
+
- Local image - Supported on all platforms
544
542
545
543
```js
546
544
tabBarIcon: {
@@ -574,6 +572,15 @@ The icon can be of following types with `native` implementation:
574
572
}
575
573
```
576
574
575
+
-[Material Symbols](https://fonts.google.com/icons) name - Supported on Android
576
+
577
+
```js
578
+
tabBarIcon: {
579
+
type:'materialSymbol',
580
+
name:'favorite',
581
+
}
582
+
```
583
+
577
584
-[Drawable resource](https://developer.android.com/guide/topics/resources/drawable-resource) name - Supported on Android
578
585
579
586
```js
@@ -583,7 +590,7 @@ The icon can be of following types with `native` implementation:
583
590
}
584
591
```
585
592
586
-
To render different icons for active and inactive states with `native` implementation, you can use a function:
593
+
To render different icons for active and inactive states, you can use a function:
-[`tabBarIcon`](bottom-tab-navigator.md#tabbaricon) is a supported option in bottom tab navigator. So we know we can use it on our screen components in the `options` prop.
99
107
-`tabBarIcon` is an object specifying the icon to display.
100
108
- For iOS, you can use SF Symbols by setting `type: 'sfSymbol'` and providing the symbol `name`.
109
+
- For Android, you can use Material Symbols by setting `type: 'materialSymbol'` and providing the symbol `name`.
101
110
- For other platforms, use `type: 'image'` with a `source` pointing to your image file. Image files must be provided for multiple screen densities (1x, 2x, 3x), e.g.: `home-icon.png`, `home-icon@2x.png`, `home-icon@3x.png`.
102
111
-[`Platform.select`](https://reactnative.dev/docs/platform#select) can be used to provide different icons based on the platform.
103
112
- The `tabBarActiveTintColor` and `tabBarInactiveTintColor` options in `screenOptions` control the icon and label colors. These default to the iOS platform defaults, but you can change them as shown above.
0 commit comments