Skip to content

React Native wrapper for the Android ViewPager and iOS UIPageViewController.

License

Notifications You must be signed in to change notification settings

callstack/react-native-pager-view

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7da2bcd · Apr 15, 2019

History

98 Commits
Feb 12, 2019
Feb 12, 2019
Feb 19, 2019
Apr 15, 2019
Mar 13, 2019
Feb 18, 2019
Feb 11, 2019
Feb 11, 2019
Feb 11, 2019
Mar 18, 2019
Feb 11, 2019
Mar 13, 2019
Apr 15, 2019
Feb 11, 2019
Apr 15, 2019
Mar 13, 2019
Feb 11, 2019

Repository files navigation

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
  },
})