-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
Description
Is your feature request related to a problem? Please Describe.
Add ScrollViewProps or ScrollViewStyle to Tab component props. specially style is really important, I wanted to add contentContainerStyle for the scrollView but it was not possible
Describe the solution you'd like
import React from "react";
import { Tab, Text, TabView } from "@rneui/themed";
export default () => {
const [index, setIndex] = React.useState(0);
return (
<>
<Tab
value={index}
onChange={(e) => setIndex(e)}
scrollViewProps={{ // << Here our new props
contentContainerStyle: {
paddingHorizontal: 12,
},
}}
indicatorStyle={{
backgroundColor: "white",
height: 3,
}}
variant="primary"
>
<Tab.Item
title="Recent"
titleStyle={{ fontSize: 12 }}
icon={{ name: "timer", type: "ionicon", color: "white" }}
/>
<Tab.Item
title="favorite"
titleStyle={{ fontSize: 12 }}
icon={{ name: "heart", type: "ionicon", color: "white" }}
/>
<Tab.Item
title="cart"
titleStyle={{ fontSize: 12 }}
icon={{ name: "cart", type: "ionicon", color: "white" }}
/>
</Tab>
<TabView value={index} onChange={setIndex} animationType="spring">
<TabView.Item style={{ backgroundColor: "red", width: "100%" }}>
<Text h1>Recent</Text>
</TabView.Item>
<TabView.Item style={{ backgroundColor: "blue", width: "100%" }}>
<Text h1>Favorite</Text>
</TabView.Item>
<TabView.Item style={{ backgroundColor: "green", width: "100%" }}>
<Text h1>Cart</Text>
</TabView.Item>
</TabView>
</>
);
};