Swiper for ReactNative apps
react-native-interactable-swiper
Then link react-native-interactable.
import { Swiper, } from 'react-native-interactable-swiper';
export default class UserProfileSwiper extends PureComponent {
render() {
return (
<Swiper
style={styles.swiper}
dotStyle={styles.dot}
activeDotStyle={styles.activeDot}
paginationStyle={styles.pagination}
vertical={true}
onIndexChanged={(index) => { console.log(index); }}
>
<View>...</View>
<View>...</View>
<View>...</View>
<View>...</View>
</Swiper>
);
}
}onIndexChanged(function) - Called with the new index when the user swiped, or auto-swipe completed
onIndexChanged={(index) => {}}autoplay(boolean) - Set totrueenable auto play mode (defaultfalse)
autoplay={true}vertical(boolean) - Iftrue, the swiper children are arranged vertically in a column (defaultfalse- children are arranged horizontally in a row)
vertical={true}style(StyleSheetobject) - Container styles
style={{...}}paginationStyle(StyleSheetobject) - Pagination container styles
paginationStyle={{...}}dotStyle(StyleSheetobject) - Pagination dots styles
dotStyle={{...}}activeDotStyle(StyleSheetobject) - Pagination active dot styles
activeDotStyle={{...}}renderPagination(function) - Complete control how to render pagination with two params (activeIndex, total)
renderPagination={
(activeIndex, total) => {
return <View>...</View>;
}
}hidePagination(boolean) - Set totrueprevent padination rendering (defaultfalse)
hidePagination={true}