File tree Expand file tree Collapse file tree 7 files changed +37
-18
lines changed
packages/react-native-bottom-tabs/src Expand file tree Collapse file tree 7 files changed +37
-18
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' react-native-bottom-tabs ' : minor
3
+ ---
4
+
5
+ feat!: add tabBarStyle, remove barTintColor prop
Original file line number Diff line number Diff line change @@ -52,8 +52,8 @@ const FourTabsOpaqueScrollEdgeAppearance = () => {
52
52
return < FourTabs scrollEdgeAppearance = "opaque" /> ;
53
53
} ;
54
54
55
- const FourTabsWithBarTintColor = ( ) => {
56
- return < FourTabs barTintColor = { '#87CEEB' } /> ;
55
+ const FourTabsWithBackgroundColor = ( ) => {
56
+ return < FourTabs backgroundColor = { '#87CEEB' } /> ;
57
57
} ;
58
58
59
59
const FourTabsTranslucent = ( ) => {
@@ -108,7 +108,7 @@ const examples = [
108
108
platform : 'ios' ,
109
109
} ,
110
110
{
111
- component : FourTabsWithBarTintColor ,
111
+ component : FourTabsWithBackgroundColor ,
112
112
name : 'Four Tabs - Custom Background Color of Tabs' ,
113
113
} ,
114
114
{
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ interface Props {
10
10
ignoresTopSafeArea ?: boolean ;
11
11
disablePageAnimations ?: boolean ;
12
12
scrollEdgeAppearance ?: 'default' | 'opaque' | 'transparent' ;
13
- barTintColor ?: ColorValue ;
13
+ backgroundColor ?: ColorValue ;
14
14
translucent ?: boolean ;
15
15
hideOneTab ?: boolean ;
16
16
rippleColor ?: ColorValue ;
@@ -21,7 +21,7 @@ export default function FourTabs({
21
21
ignoresTopSafeArea = false ,
22
22
disablePageAnimations = false ,
23
23
scrollEdgeAppearance = 'default' ,
24
- barTintColor ,
24
+ backgroundColor ,
25
25
translucent = true ,
26
26
hideOneTab = false ,
27
27
rippleColor,
@@ -71,7 +71,7 @@ export default function FourTabs({
71
71
navigationState = { { index, routes } }
72
72
onIndexChange = { setIndex }
73
73
renderScene = { renderScene }
74
- barTintColor = { barTintColor }
74
+ tabBarStyle = { { backgroundColor } }
75
75
translucent = { translucent }
76
76
rippleColor = { rippleColor }
77
77
activeIndicatorColor = { activeIndicatorColor }
Original file line number Diff line number Diff line change @@ -15,7 +15,9 @@ function NativeBottomTabs() {
15
15
hapticFeedbackEnabled = { false }
16
16
tabBarInactiveTintColor = "#C57B57"
17
17
tabBarActiveTintColor = "#F7DBA7"
18
- barTintColor = "#1E2D2F"
18
+ tabBarStyle = { {
19
+ backgroundColor : '#1E2D2F' ,
20
+ } }
19
21
rippleColor = "#F7DBA7"
20
22
tabLabelStyle = { {
21
23
fontFamily : 'Avenir' ,
Original file line number Diff line number Diff line change @@ -156,12 +156,16 @@ Color for the active tab.
156
156
#### ` tabBarInactiveTintColor `
157
157
158
158
Color for inactive tabs.
159
+
159
160
- Type: ` ColorValue `
160
161
161
- #### ` barTintColor `
162
+ #### ` tabBarStyle `
162
163
163
- Background color of the tab bar.
164
- - Type: ` ColorValue `
164
+ Object containing styles for the tab bar.
165
+
166
+ Supported properties:
167
+
168
+ - ` backgroundColor ` : Background color of the tab bar.
165
169
166
170
#### ` translucent ` <Badge text =" iOS " type =" info " />
167
171
Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ It supports the following values:
96
96
#### ` labeled `
97
97
98
98
Whether to show labels in tabs.
99
+
99
100
- Type: ` boolean `
100
101
- Default <Badge text = " iOS" type = " info" />: ` true `
101
102
- Default <Badge text = " Android" type = " info" />: ` false `
@@ -130,9 +131,13 @@ Color for the active tab.
130
131
131
132
Color for the inactive tabs.
132
133
133
- #### ` barTintColor `
134
+ #### ` tabBarStyle `
135
+
136
+ Object containing styles for the tab bar.
137
+
138
+ Supported properties:
134
139
135
- Background color of the tab bar.
140
+ - ` backgroundColor ` : Background color of the tab bar.
136
141
137
142
#### ` activeIndicatorColor ` <Badge text = " android" type = " info" />
138
143
Original file line number Diff line number Diff line change @@ -116,10 +116,13 @@ interface Props<Route extends BaseRoute> {
116
116
*/
117
117
getTestID ?: ( props : { route : Route } ) => string | undefined ;
118
118
119
- /**
120
- * Background color of the tab bar.
121
- */
122
- barTintColor ?: ColorValue ;
119
+ tabBarStyle ?: {
120
+ /**
121
+ * Background color of the tab bar.
122
+ */
123
+ backgroundColor ?: ColorValue ;
124
+ } ;
125
+
123
126
/**
124
127
* A Boolean value that indicates whether the tab bar is translucent. (iOS only)
125
128
*/
@@ -166,10 +169,10 @@ const TabView = <Route extends BaseRoute>({
166
169
? route . focusedIcon
167
170
: route . unfocusedIcon
168
171
: route . focusedIcon ,
169
- barTintColor,
170
172
getHidden = ( { route } : { route : Route } ) => route . hidden ,
171
173
getActiveTintColor = ( { route } : { route : Route } ) => route . activeTintColor ,
172
174
getTestID = ( { route } : { route : Route } ) => route . testID ,
175
+ tabBarStyle,
173
176
hapticFeedbackEnabled = false ,
174
177
tabLabelStyle,
175
178
...props
@@ -290,7 +293,7 @@ const TabView = <Route extends BaseRoute>({
290
293
hapticFeedbackEnabled = { hapticFeedbackEnabled }
291
294
activeTintColor = { activeTintColor }
292
295
inactiveTintColor = { inactiveTintColor }
293
- barTintColor = { barTintColor }
296
+ barTintColor = { tabBarStyle ?. backgroundColor }
294
297
rippleColor = { rippleColor }
295
298
>
296
299
{ trimmedRoutes . map ( ( route ) => {
You can’t perform that action at this time.
0 commit comments