Gathering detailed insights and metrics for react-easy-swipe
Gathering detailed insights and metrics for react-easy-swipe
Gathering detailed insights and metrics for react-easy-swipe
Gathering detailed insights and metrics for react-easy-swipe
npm install react-easy-swipe
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
104 Stars
126 Commits
32 Forks
6 Watching
4 Branches
14 Contributors
Updated on 14 May 2024
Minified
Minified + Gzipped
JavaScript (72.4%)
HTML (27.6%)
Cumulative downloads
Total Downloads
Last day
-2.2%
56,443
Compared to previous day
Last week
3.3%
313,942
Compared to previous week
Last month
6.1%
1,330,173
Compared to previous month
Last year
22%
19,074,879
Compared to previous year
1
33
Add swipe interactions to your react component.
http://leandrowd.github.io/react-easy-swipe/
To prevent scroll during swipe, return true from the handler passed to onSwipeMove
To allow mouse events to behave like touch, pass a prop allowMouseEvents
To prevent accidental swipes on scroll, pass a prop tolerance with the tolerance pixel as number.
npm install react-easy-swipe --save
1import React, {Component} from 'react'; 2import ReactDOM from 'react-dom'; 3import Swipe from 'react-easy-swipe'; 4 5class MyComponent extends Component { 6 onSwipeStart(event) { 7 console.log('Start swiping...', event); 8 } 9 10 onSwipeMove(position, event) { 11 console.log(`Moved ${position.x} pixels horizontally`, event); 12 console.log(`Moved ${position.y} pixels vertically`, event); 13 } 14 15 onSwipeEnd(event) { 16 console.log('End swiping...', event); 17 } 18 19 render() { 20 const boxStyle = { 21 width: '100%', 22 height: '300px', 23 border: '1px solid black', 24 background: '#ccc', 25 padding: '20px', 26 fontSize: '3em' 27 }; 28 29 return ( 30 <Swipe 31 onSwipeStart={this.onSwipeStart} 32 onSwipeMove={this.onSwipeMove} 33 onSwipeEnd={this.onSwipeEnd}> 34 <div style={boxStyle}>Open the console and swipe me</div> 35 </Swipe> 36 ); 37 } 38} 39 40ReactDOM.render(<MyComponent/>, document.getElementById('root')); 41
1{ 2 tagName: PropTypes.string, 3 className: PropTypes.string, 4 style: PropTypes.object, 5 children: PropTypes.node, 6 allowMouseEvents: PropTypes.bool, 7 onSwipeUp: PropTypes.func, 8 onSwipeDown: PropTypes.func, 9 onSwipeLeft: PropTypes.func, 10 onSwipeRight: PropTypes.func, 11 onSwipeStart: PropTypes.func, 12 onSwipeMove: PropTypes.func, 13 onSwipeEnd: PropTypes.func, 14 tolerance: PropTypes.number.isRequired 15}
Please, feel free to contribute. You may open a bug, request a feature, submit a pull request or whatever you want!
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 4/14 approved changesets -- score normalized to 2
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
59 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