@@ -22,6 +22,7 @@ type TabBarProps = SceneRendererProps & {
22
22
} ;
23
23
type TabBarPosition = "top" | "bottom" ;
24
24
type KeyboardDismissMode = "none" | "auto" | "on-drag" ;
25
+ type IconPosition = "top" | "bottom" | "left" | "right" ;
25
26
26
27
type TabViewProps = {
27
28
onIndexChanged ?: ( index : number ) => void ;
@@ -37,6 +38,7 @@ type TabViewProps = {
37
38
indicatorColor ?: string ;
38
39
tabsBackgroundColor ?: string ;
39
40
iconSize ?: number ;
41
+ iconPosition ?: IconPosition ;
40
42
style ?: StyleProp < ViewStyle | TextStyle > ;
41
43
theme : Theme ;
42
44
} & IconSlot ;
@@ -56,6 +58,7 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
56
58
indicatorColor,
57
59
tabsBackgroundColor,
58
60
iconSize = 16 ,
61
+ iconPosition = "top" ,
59
62
style,
60
63
theme,
61
64
children : childrenProp ,
@@ -101,6 +104,21 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
101
104
} ;
102
105
103
106
const renderTabBar : React . FC < TabBarProps > = ( props ) => {
107
+ let tabFlexDirection : "row" | "column" | "row-reverse" | "column-reverse" ;
108
+ switch ( iconPosition ) {
109
+ case "top" :
110
+ tabFlexDirection = "column" ;
111
+ break ;
112
+ case "bottom" :
113
+ tabFlexDirection = "column-reverse" ;
114
+ break ;
115
+ case "left" :
116
+ tabFlexDirection = "row" ;
117
+ break ;
118
+ case "right" :
119
+ tabFlexDirection = "row-reverse" ;
120
+ break ;
121
+ }
104
122
return (
105
123
< TabBar
106
124
{ ...props }
@@ -112,6 +130,7 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
112
130
backgroundColor : indicatorColor || theme . colors . primary ,
113
131
} }
114
132
labelStyle = { [ { textTransform : "none" } , textStyles ] }
133
+ tabStyle = { { flexDirection : tabFlexDirection } }
115
134
renderIcon = { ( { route, color } ) =>
116
135
route ?. icon ? (
117
136
< Icon name = { route . icon } color = { color } size = { iconSize } />
0 commit comments