Gathering detailed insights and metrics for react-view-pager
Gathering detailed insights and metrics for react-view-pager
Gathering detailed insights and metrics for react-view-pager
Gathering detailed insights and metrics for react-view-pager
react-native-pager-view
React Native wrapper for Android and iOS ViewPager
@react-native-oh-tpl/react-native-pager-view
React Native wrapper for Harmony ViewPager
@strelka/react-view-pager
View-Pager/Slider/Carousel powered by React Motion.
pager-view
A wrapper that works on multiple platforms: Android, iOS, and Web
npm install react-view-pager
Typescript
Module System
Node Version
NPM Version
92.2
Supply Chain
94.6
Quality
74.4
Maintenance
100
Vulnerability
99.6
License
JavaScript (96.6%)
CSS (2.74%)
HTML (0.66%)
Total Downloads
9,173,930
Last Day
582
Last Week
18,626
Last Month
87,626
Last Year
1,222,506
MIT License
293 Stars
196 Commits
46 Forks
10 Watchers
5 Branches
7 Contributors
Updated on Mar 21, 2024
Minified
Minified + Gzipped
Latest Version
0.6.0
Package Id
react-view-pager@0.6.0
Size
61.97 kB
NPM Version
5.6.0
Node Version
8.9.4
Cumulative downloads
Total Downloads
Last Day
-16.3%
582
Compared to previous day
Last Week
-13%
18,626
Compared to previous week
Last Month
-15.2%
87,626
Compared to previous month
Last Year
-12.1%
1,222,506
Compared to previous year
3
24
View-Pager/Slider/Carousel powered by React Motion.
Use at your own risk, API's are subject to change. It's been fairly stable these last few months, but still might change slightly. Once the outstanding issues are fixed I will release 1.0.0.
yarn add react-view-pager
npm install react-view-pager --save
1<script src="https://unpkg.com/react-view-pager/dist/react-view-pager.js"></script> 2(UMD library exposed as `ReactViewPager`)
1import { ViewPager, Frame, Track, View } from 'react-view-pager' 2 3<ViewPager tag="main"> 4 <Frame className="frame"> 5 <Track 6 ref={c => this.track = c} 7 viewsToShow={2} 8 infinite 9 className="track" 10 > 11 <View className="view">1</View> 12 <View className="view">2</View> 13 <View className="view">3</View> 14 <View className="view">4</View> 15 </Track> 16 </Frame> 17 <nav className="pager-controls"> 18 <a 19 className="pager-control pager-control--prev" 20 onClick={() => this.track.prev()} 21 > 22 Prev 23 </a> 24 <a 25 className="pager-control pager-control--next" 26 onClick={() => this.track.next()} 27 > 28 Next 29 </a> 30 </nav> 31</ViewPager>
ViewPager
Propstag
: PropTypes.stringThe HTML tag for this element. Defaults to div
.
Frame
Propstag
: PropTypes.stringThe HTML tag for this element. Defaults to div
.
autoSize
: PropTypes.oneOf([true, false, 'width', 'height'])Animates the wrapper's width and/or height to fit the current view. Defaults to false
.
accessibility
: PropTypes.boolEnable tabbing and keyboard navigation.
springConfig
: React.PropTypes.objectOf(React.PropTypes.number)Accepts a React Motion spring config.
Track
Propstag
: PropTypes.stringThe HTML tag for this element. Defaults to div
.
currentView
: PropTypes.anySpecify the index or key of a view to move to that view. Use with onViewChange
to control the state of the pager.
viewsToShow
: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf(['auto'])])The number of views visible in the frame at one time. Defaults to 1
. Use auto
to respect the views's natural or defined dimensions.
viewsToMove
: PropTypes.numberThe number of views to move upon using prev
and next
methods. Defaults to 1
.
align
: PropTypes.numberPass any number to offset the view from the start of the track. For example, 0
aligns to the start of the track, 0.5
to the center, and 1
aligns to the end.
contain
: PropTypes.boolPrevents empty space from showing in frame. Defaults to false
.
infinite
: PropTypes.boolPrepare your pager for intergalactic space travel. Allows the track to wrap to the beginning/end when moving to a view. To infinity and beyond!
instant
: PropTypes.boolMove to a view instantly without any animation. This will control the internal instant
state inside of the component.
axis
: PropTypes.oneOf(['x', 'y'])Which axis the track moves on. Defaults to x
.
animations
: PropTypes.arrayDefine a limitless array of animation stops. Each object in the array requires a prop
and stops
property along with an optional unit
property.
1// scale and fade views as they enter and leave 2const animations = [{ 3 prop: 'scale', 4 stops: [ 5 [-200, 0.85], 6 [0, 1], 7 [200, 0.85] 8 ] 9}, { 10 prop: 'opacity', 11 stops: [ 12 [-200, 0.15], 13 [0, 1], 14 [200, 0.15] 15 ] 16}]
swipe
: PropTypes.oneOf([true, false, 'touch', 'mouse'])Enable touch and/or mouse dragging. Defaults to true
.
swipeThreshold
: PropTypes.numberThe amount the user must swipe to advance views. (frameWidth * swipeThreshold)
. Defaults to 0.5
.
flickTimeout
: PropTypes.numberThe amount of time in milliseconds that determines if a swipe was a flick or not.
rightToLeft
: PropTypes.bool (Coming Soon)lazyLoad
: PropTypes.bool (Coming Soon)springConfig
: React.PropTypes.objectOf(React.PropTypes.number)Accepts a React Motion spring config.
onSwipeStart
: PropTypes.funcProp callback fired before swipe.
onSwipeMove
: PropTypes.funcProp callback fired during swipe.
onSwipeEnd
: PropTypes.funcProp callback fired after swipe.
onScroll
: PropTypes.funcProp callback fired when track is scrolling. Useful for parallax or progress bars.
onViewChange
: PropTypes.funcProp callback fired when view changes. Passes back the newly selected indicies.
onRest
: PropTypes.funcProp callback fired after track scrolling animation settles.
prev
Moves to the previous view.
next
Advances to the next view.
scrollTo
Scroll to a view by it's index or key.
View
Propstag
: PropTypes.stringThe HTML tag for this element. Defaults to div
.
clone repo
git clone git@github.com:souporserious/react-view-pager.git
move into folder
cd ~/react-view-pager
install dependencies
npm install
run dev mode
npm run dev
open your browser and visit: http://localhost:8080/
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 3/27 approved changesets -- score normalized to 1
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
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
115 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
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