@@ -22,6 +22,7 @@ type TabBarProps = SceneRendererProps & {
2222} ;
2323type TabBarPosition = "top" | "bottom" ;
2424type KeyboardDismissMode = "none" | "auto" | "on-drag" ;
25+ type IconPosition = "top" | "bottom" | "left" | "right" ;
2526
2627type TabViewProps = {
2728 onIndexChanged ?: ( index : number ) => void ;
@@ -37,6 +38,7 @@ type TabViewProps = {
3738 indicatorColor ?: string ;
3839 tabsBackgroundColor ?: string ;
3940 iconSize ?: number ;
41+ iconPosition ?: IconPosition ;
4042 style ?: StyleProp < ViewStyle | TextStyle > ;
4143 theme : Theme ;
4244} & IconSlot ;
@@ -56,6 +58,7 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
5658 indicatorColor,
5759 tabsBackgroundColor,
5860 iconSize = 16 ,
61+ iconPosition = "top" ,
5962 style,
6063 theme,
6164 children : childrenProp ,
@@ -101,6 +104,21 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
101104 } ;
102105
103106 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+ }
104122 return (
105123 < TabBar
106124 { ...props }
@@ -112,6 +130,7 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
112130 backgroundColor : indicatorColor || theme . colors . primary ,
113131 } }
114132 labelStyle = { [ { textTransform : "none" } , textStyles ] }
133+ tabStyle = { { flexDirection : tabFlexDirection } }
115134 renderIcon = { ( { route, color } ) =>
116135 route ?. icon ? (
117136 < Icon name = { route . icon } color = { color } size = { iconSize } />
0 commit comments