Gathering detailed insights and metrics for react-native-tab-view-viewpager-adapter
Gathering detailed insights and metrics for react-native-tab-view-viewpager-adapter
Gathering detailed insights and metrics for react-native-tab-view-viewpager-adapter
Gathering detailed insights and metrics for react-native-tab-view-viewpager-adapter
react-native-tab-view
Tab view component for React Native
react-native-pager-view
React Native wrapper for Android and iOS ViewPager
@react-navigation/material-top-tabs
Integration for the animated tab view component from react-native-tab-view
react-native-tab-view-next
Tab view component for React Native
npm install react-native-tab-view-viewpager-adapter
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
78 Stars
28 Commits
13 Forks
5 Watching
37 Branches
6 Contributors
Updated on 05 Apr 2024
TypeScript (30.79%)
Java (20.79%)
Objective-C (16.59%)
Starlark (12.82%)
JavaScript (12.25%)
Ruby (6.77%)
Cumulative downloads
Total Downloads
Last day
40%
14
Compared to previous day
Last week
11.6%
77
Compared to previous week
Last month
40.5%
326
Compared to previous month
Last year
-88.9%
4,764
Compared to previous year
6
25
This library is an adapter that allows for utilizing React Native ViewPager in React Native Tab View. With this package, you can replace existing pager responsible for scrolling experience with a purely native one.
React Native ViewPager under the hood uses native UIViewPagerController
on iOS and ViewPager
on Android. Although it's not that customizable as React Native Tab View's Pager built with Reanimated and Gesture Handler, it can deliver a bit better native feeling and expose some options not available in TabView by default.
1import React, { useState } from 'react'; 2import { TabView, SceneMap } from 'react-native-tab-view'; 3import ViewPagerAdapter from 'react-native-tab-view-viewpager-adapter'; 4 5<TabView 6 renderScene={() => {/* render */}} 7 renderTabBar={() => null} 8 renderPager={props => ( 9 <ViewPagerAdapter {...props} transition="curl" showPageIndicator /> 10 )} 11/> 12
ViewPagerAdapter
accepts a set of props needed for adapting to Internal API of React Native Tab View and are not described here neither supposed to be used.
However, there are few more additional props:
Prop | Description | Platform |
---|---|---|
style: Style | Style to apply to ViewPager | both |
pageMargin: number | Blank space to be shown between pages | both |
orientation: Orientation | Set horizontal or vertical scrolling orientation (it does not work dynamically) | both |
transition: string | Use scroll or curl to change transition style (it does not work dynamically) | iOS |
showPageIndicator: boolean | Shows the dots indicator at the bottom of the view | iOS |
overdrag: boolean | Allows for overscrolling after reaching the end or very beginning of pages | iOS |
overScrollMode: OverScollMode | Used to override default value of overScroll mode. Can be auto, always or never. Defaults to auto | Android |
You can find more resources in React Native ViewPager documentation
1const SwipeStack = createMaterialTopTabNavigator( 2 { 3 A: { 4 name: 'A screen', 5 screen: ScreenA, 6 }, 7 B: { 8 name: 'B screen', 9 screen: ScreenB, 10 }, 11 }, 12 { 13 pagerComponent: ViewPagerAdapter 14 } 15);
1const MaterialTopTabs = createMaterialTopTabNavigator<MaterialTopTabParams>(); 2 3export default function MaterialTopTabsScreen() { 4 return ( 5 <MaterialTopTabs.Navigator 6 pager={props => <ViewPagerAdapter {...props} />} 7 > 8 <MaterialTopTabs.Screen 9 name="A" 10 component={ScreenA} 11 options={{ title: 'Chat' }} 12 /> 13 <MaterialTopTabs.Screen 14 name="contacts" 15 component={ScreenB} 16 options={{ title: 'Contacts' }} 17 /> 18 </MaterialTopTabs.Navigator> 19 ); 20}
yarn add react-native-tab-view-viewpager-adapter
Also, you need to set up React Native View Pager
renderPager
prop in React Native Tab View is available only from version 2.11.0
We created a React Native example which can be run with following commands:
1cd example 2react-native run-android
or
1cd example 2cd ios 3pod install 4cd .. 5react-native run-ios
No vulnerabilities found.
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 4/25 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
87 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More