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
feat: render colored icons with iconRenderingMode original (#542)
* feat(iOS): render colored icons with iconRenderingMode alwaysOriginal
* chore: fix alwaysOriginal tab label color when hovering
* chore: support iconRenderingMode on Android
* chore: rename alwaysOriginal option to original
* chore: cleanup
Function that returns a React element to render as [bottom accessory](https://developer.apple.com/documentation/uikit/uitabbarcontroller/bottomaccessory).
@@ -286,9 +286,29 @@ Function that given `{ focused: boolean }` returns `ImageSource` or `AppleIcon`
286
286
SF Symbols are only supported on Apple platforms.
287
287
:::
288
288
289
+
#### `tabBarIconRenderingMode`
290
+
291
+
Rendering mode for image icons.
292
+
293
+
- Type: `'automatic' | 'original'`
294
+
- Default: `'automatic'`
295
+
296
+
Use `original` to preserve the original colors of multicolor image icons, such as logos or branded assets, instead of applying the native tab tint.
297
+
298
+
```tsx
299
+
<Tab.Screen
300
+
name="Brand"
301
+
component={Brand}
302
+
options={{
303
+
tabBarIcon: () =>require('brand-logo.png'),
304
+
tabBarIconRenderingMode: 'original',
305
+
}}
306
+
/>
307
+
```
308
+
289
309
:::warning
290
310
291
-
Metro transformers that modify the import resolutions of images to something that is *not* React Native's `ImageSource` will break this. A notable community example of such is [react-native-svg-transformer](https://github.com/kristerkari/react-native-svg-transformer).
311
+
Metro transformers that modify the import resolutions of images to something that is _not_ React Native's `ImageSource` will break this. A notable community example of such is [react-native-svg-transformer](https://github.com/kristerkari/react-native-svg-transformer).
292
312
293
313
For best results, avoid the use of such transformers altogether.
@@ -329,14 +349,14 @@ To display a badge without text (just a dot), you need to pass a string with a s
329
349
330
350
#### `tabBarBadgeBackgroundColor`
331
351
332
-
- Type: `string`
352
+
- Type: `string`
333
353
334
354
Set the background color for the badge on android.
335
355
Uses the system color by default.
336
356
337
357
#### `tabBarBadgeTextColor`
338
358
339
-
- Type: `string`
359
+
- Type: `string`
340
360
341
361
Set the text color for the badge on android.
342
362
Uses the system color by default.
@@ -356,6 +376,7 @@ Due to native limitations on iOS, this option doesn't hide the tab item **when h
356
376
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.
357
377
358
378
#### `freezeOnBlur`
379
+
359
380
Boolean indicating whether to prevent inactive screens from re-rendering. Defaults to false.
360
381
361
382
It's working separately from `enableFreeze()` in `react-native-screens`. So settings won't be shared between them.
@@ -371,7 +392,6 @@ Whether to prevent default tab switching behavior when this tab is pressed. This
371
392
Due to iOS 26's new tab switching animations, controlling tab switching from JavaScript can cause significant delays. The `preventsDefault` option allows you to define this behavior statically to avoid animation delays.
372
393
:::
373
394
374
-
375
395
#### `tabBarButtonTestID`
376
396
377
397
Test ID for the tab item. This can be used to find the tab item in the native view hierarchy.
0 commit comments