react-native-pg-swiper
Page Swiper component for React Native.
Getting Started
Installation
$ npm i react-native-pg-swiper --save
$ yarn add react-native-pg-swiper
Basic Usage
- Edit your
app.js
, like this:
import React from 'react';import Swiper from 'react-native-pg-swiper';import AppRegistry StyleSheet Text View from 'react-native'; var styles = StyleSheet { thisrefsswiper;} Component { return <Swiper ='swiper' => <View => <Text =>Hello Swiper</Text> </View> <View => <Text =>Beautiful</Text> </View> <View => <Text =>And simple</Text> </View> </Swiper> ; } AppRegistry;
Properties
Prop | Default | Type | Description |
---|---|---|---|
index | 0 |
number |
Index number of initial slide. |
pager | true |
boolean |
Show pager. |
onPageChange | function |
Callback when page changes. | |
activeDotColor | blue |
string |
CSS color of the dot for the current page. |
threshold | 25 |
number |
Threshold before the swiper captures the pan responder |
disableLastSwipe | false |
boolean |
Disable Swipe effect on start and end page |
ref | `` | string |
Give Reference to Swiper to use changePage method |
method
Prop | params | Type | Description |
---|---|---|---|
changePage | index | function |
Change To Particular Page. Usage this.refs.swiper.changePage(index); |
Examples
See code in examples.