Skip to content
React Native wrapper for the Android ViewPager.
Branch: master
Clone or download
Latest commit 7da2bcd Apr 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci chore: add CircleCI config (#3) Feb 12, 2019
android fix: measure and layout after adding a view to the container (#2) Feb 12, 2019
example Add to examples button that dynamically attach new view to ViewPager (#5 Feb 19, 2019
ios fix: podspec errors. (#21) Apr 15, 2019
js fix: switch main export for Jest to work out of the box Mar 13, 2019
typings chore: added typings (#10) Feb 18, 2019
.flowconfig
.gitattributes Migrate the ViewPager module from React Native core to the community … Feb 11, 2019
.gitignore
.npmignore
LICENSE
README.md
RNCViewpager.podspec fix: podspec errors. (#21) Apr 15, 2019
babel.config.js
package.json
viewpager.gif
yarn.lock

README.md

react-native-viewpager

CircleCI branch

Note: This module has been extracted from react-native as a part of the Lean Core effort.

For now, this module only works for Android. Under the hood it is using the native Android ViewPager.

Getting started

yarn add @react-native-community/viewpager

Mostly automatic installation

react-native link @react-native-community/viewpager

Usage

import ViewPager from "@react-native-community/viewpager";

class MyPager extends React.Component { 
  render() {
    return (
      <ViewPager
        style={styles.viewPager}
        initialPage={0}>
        <View key="1">
          <Text>First page</Text>
        </View>
        <View key="2">
          <Text>Second page</Text>
        </View>
      </ViewPager>
    );
  }
}

const styles = StyleSheet.create({
  viewPager: {
    flex: 1
  },
})
You can’t perform that action at this time.