meliorence / react-native-snap-carousel

Swiper/carousel component for React Native featuring previews, multiple layouts, parallax images, performant handling of huge numbers of items, and more. Compatible with Android & iOS.
BSD 3-Clause "New" or "Revised" License
10.37k stars 2.29k forks source link

Show different UI when item is active #895

Open acopetkovic opened 3 years ago

acopetkovic commented 3 years ago

Is it possible to show the buttons only on active item and the items that are not active don't have any buttons? carousel

Navipro70 commented 2 years ago

@acopetkovic Just use onSnapToItem prop to get active index, and compare if card is active (index === activeIndex) - show buttons, if is not active - hide.