reactrondev/react-native-web-swiper

Custom inactive dot style

jsbeaudry opened this issue · 5 comments

How can i custom the style of my inactive dot?

oxyii commented

Added to README

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

@oxyii Thank You. Got it.