Custom inactive dot style
jsbeaudry opened this issue · 5 comments
jsbeaudry commented
How can i custom the style of my inactive dot?
SupriyaGo commented
but dotActiveStyle is not working when I am customizing the DotComponent. How to do?
oxyii commented
@SupriyaGo What for dotActiveStyle
if you are using DotComponent
? DotComponent will be rendered with three props from swiper: index
, isActive
(bool) and onPress
(can be null if dots is not touchable).
So you can render dots as you want
<Swiper
controlsProps={{
DotComponent: ({ index, isActive, onPress }) => {
if (isActive) {
return <Text onPress={onPress}>Your Active Dot {index+1}</Text>;
}
return <Text onPress={onPress}>Your Inactive Dot {index+1}</Text>;
}
}}
/>
About dotActiveStyle
: see README. It's react-native-elements
Badge badgeStyle