Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/grumpy-otters-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-native-bottom-tabs': patch
---

Disable tabBarInactiveTintColor on iOS >= 26
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#
.DS_Store

# XDE
.expo/

# VSCode
.vscode/
jsconfig.json
Expand Down Expand Up @@ -82,3 +79,6 @@ lib/
# React Native Codegen
ios/generated
android/generated

# Codex
.codex
4 changes: 4 additions & 0 deletions docs/docs/docs/guides/standalone-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ Color for inactive tabs.

- Type: `ColorValue`

:::note
On iOS >= 26 (Liquid Glass), this prop is ignored.
:::

#### `tabBarStyle`

Object containing styles for the tab bar.
Expand Down
10 changes: 7 additions & 3 deletions docs/docs/docs/guides/usage-with-react-navigation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ Color for the active tab.

Color for the inactive tabs.

:::note
On iOS >= 26 (Liquid Glass), this prop is ignored.
:::

#### `tabBarStyle`

Object containing styles for the tab bar.
Expand Down Expand Up @@ -241,7 +245,7 @@ Label text of the tab displayed in the navigation bar. When undefined, scene tit
Color for the active tab.

:::note
The `tabBarInactiveTintColor` is not supported on route level due to native limitations. Use `inactiveTintColor` in the `Tab.Navigator` instead.
The `tabBarInactiveTintColor` is not supported on route level due to native limitations. Use `tabBarInactiveTintColor` in the `Tab.Navigator` instead.
:::

#### `tabBarIcon`
Expand Down Expand Up @@ -312,7 +316,7 @@ To display a badge without text (just a dot), you need to pass a string with a s
#### `tabBarBadgeBackgroundColor`

- Type: `string`

Set the background color for the badge on android.
Uses the system color by default.

Expand Down Expand Up @@ -395,7 +399,7 @@ React.useEffect(() => {
const unsubscribe = navigation.addListener('tabPress', (e) => {
// Note: For iOS 26+, use the `preventsDefault` option instead of `e.preventDefault()`
// to avoid animation delays

// Do something manually
// ...
});
Expand Down
6 changes: 3 additions & 3 deletions packages/react-native-bottom-tabs/ios/TabViewImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ struct TabViewImpl: View {
#if !os(visionOS)
tabBar.isTranslucent = props.translucent
#endif
tabBar.unselectedItemTintColor = props.inactiveTintColor
tabBar.unselectedItemTintColor = props.effectiveInactiveTintColor

guard let items = tabBar.items else { return }

Expand Down Expand Up @@ -174,10 +174,10 @@ struct TabViewImpl: View {
fontSize: props.fontSize,
fontFamily: props.fontFamily,
fontWeight: props.fontWeight,
inactiveColor: props.inactiveTintColor
inactiveColor: props.effectiveInactiveTintColor
)

if let inactiveTintColor = props.inactiveTintColor {
if let inactiveTintColor = props.effectiveInactiveTintColor {
itemAppearance.normal.iconColor = inactiveTintColor
}

Expand Down
11 changes: 11 additions & 0 deletions packages/react-native-bottom-tabs/ios/TabViewProps.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Foundation
import SwiftUI

internal enum MinimizeBehavior: String {
Expand Down Expand Up @@ -82,6 +83,16 @@ class TabViewProps: ObservableObject {
return activeTintColor
}

var effectiveInactiveTintColor: PlatformColor? {
#if os(iOS)
if ProcessInfo.processInfo.operatingSystemVersion.majorVersion >= 26 {
return nil
}
#endif

return inactiveTintColor
}

var filteredItems: [TabInfo] {
items.filter {
!$0.hidden || $0.key == selectedPage
Expand Down
1 change: 1 addition & 0 deletions packages/react-native-bottom-tabs/src/TabView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
tabBarActiveTintColor?: ColorValue;
/**
* Inactive tab color.
* Has no effect on iOS 26 and above (Liquid Glass).
*/
tabBarInactiveTintColor?: ColorValue;
/**
Expand Down Expand Up @@ -281,7 +282,7 @@

if (!loaded.includes(focusedKey)) {
// Set the current tab to be loaded if it was not loaded before
setLoaded((loaded) => [...loaded, focusedKey]);

Check warning on line 285 in packages/react-native-bottom-tabs/src/TabView.tsx

View workflow job for this annotation

GitHub Actions / lint

'loaded' is already declared in the upper scope on line 281 column 10
}

const icons = React.useMemo(
Expand Down
Loading