{"library":"react-native-pager-view","title":"React Native Pager View","description":"react-native-pager-view is an actively maintained React Native library providing a performant, native-backed solution for implementing horizontal paging views, such as carousels or tab views. It leverages the AndroidX ViewPager2 on Android and a SwiftUI-based implementation on iOS (since v8.0.0), ensuring a smooth and idiomatic user experience. The current stable version is 8.0.1, with consistent releases addressing bug fixes and introducing new features. Maintained by Callstack, a prominent contributor to the React Native ecosystem, its key differentiators include reliance on native UI components for optimal performance, a consistent API across platforms, and the recent modernization of its iOS implementation to SwiftUI in v8, which subtly changes animation behavior for multi-page navigation. This library is ideal for scenarios requiring swipeable content sections within a React Native application.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install react-native-pager-view"],"cli":null},"imports":["import PagerView from 'react-native-pager-view';","import { default as PagerView } from 'react-native-pager-view';","import type { PagerViewProps } from 'react-native-pager-view';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import React from 'react';\nimport { StyleSheet, View, Text } from 'react-native';\nimport PagerView from 'react-native-pager-view';\n\nconst MyPagerView = () => {\n  return (\n    <PagerView style={styles.pagerView} initialPage={0}>\n      <View key=\"1\" style={styles.page}>\n        <Text style={styles.pageText}>First page</Text>\n      </View>\n      <View key=\"2\" style={styles.page}>\n        <Text style={styles.pageText}>Second page</Text>\n      </View>\n      <View key=\"3\" style={styles.page}>\n        <Text style={styles.pageText}>Third page</Text>\n      </View>\n    </PagerView>\n  );\n};\n\nconst styles = StyleSheet.create({\n  pagerView: {\n    flex: 1,\n    backgroundColor: '#ffffff',\n  },\n  page: {\n    justifyContent: 'center',\n    alignItems: 'center',\n    backgroundColor: '#f0f0f0',\n    padding: 20,\n    margin: 10,\n    borderRadius: 8,\n  },\n  pageText: {\n    fontSize: 24,\n    fontWeight: 'bold',\n    color: '#333',\n    textAlign: 'center'\n  },\n});\n\nexport default MyPagerView;\n","lang":"typescript","description":"A basic example demonstrating a `PagerView` with three simple, swipeable pages, showcasing fundamental usage and styling.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}