Gathering detailed insights and metrics for rc-hammerjs
Gathering detailed insights and metrics for rc-hammerjs
Gathering detailed insights and metrics for rc-hammerjs
Gathering detailed insights and metrics for rc-hammerjs
ReactJS / HammerJS integration. Support touch events in your React app.
npm install rc-hammerjs
Typescript
Module System
Node Version
NPM Version
81.2
Supply Chain
98.5
Quality
77.1
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
51,063,523
Last Day
3,515
Last Week
57,676
Last Month
328,191
Last Year
4,483,012
11 Stars
138 Commits
4 Forks
4 Watching
12 Branches
24 Contributors
Minified
Minified + Gzipped
Latest Version
0.6.10
Package Id
rc-hammerjs@0.6.10
Size
4.34 kB
NPM Version
6.13.1
Node Version
10.16.0
Publised On
26 May 2020
Cumulative downloads
Total Downloads
Last day
-78.6%
3,515
Compared to previous day
Last week
-27.7%
57,676
Compared to previous week
Last month
-13.5%
328,191
Compared to previous month
Last year
-8.9%
4,483,012
Compared to previous year
Fork from React-HammerJS.
ReactJS / HammerJS integration. Support touch events in your React app.
If you're looking for native tap event handling in ReactJS, check out my react-tappable package.
The easiest way to use React-HammerJS is to install it from NPM and include it in your own React build process (using Browserify, etc).
You can also use the standalone build by including dist/hammer.js
in your page. If you use this, make sure you have already included React, and it is available as a global variable.
npm install rc-hammerjs --save
React-HammerJS wraps a React component, binding Hammer events to it so it can fire the handlers specified.
The following events are supported:
onTap
onDoubleTap
onPan
onPanCancel
onPanEnd
onPanStart
onPinch
onPinchCancel
onPinchEnd
onPinchIn
onPinchOut
onPinchStart
onPress
onPressUp
onRotate
onRotateCancel
onRotateEnd
onRotateMove
onRotateStart
onSwipe
You can also provide an action
property which is like the onTap
event handler but will also be fired onPress
.
If you provide the prop direction
the pan
and swipe
events will support Hammer.DIRECTION_(NONE/LEFT/RIGHT/UP/DOWN/HORIZONTAL/VERTICAL/ALL)
.
The options
property can be used to configure the Hammer manager. These properties will be merged with the default ones.
var Hammer = require('rc-hammerjs');
// Default options
<Hammer onTap={handleTap} onSwipe={handleSwipe}><div>Tap Me</div></Hammer>
// Custom options
var options = {
touchAction:'compute',
recognizers: {
tap: {
time: 600,
threshold: 100
}
}
};
<Hammer onTap={handleTap} options={options}><div>Tap Me</div></Hammer>
As a default, the pinch
and rotate
events are disabled in hammer.js, as they would make actions on an element "blocking". You may enable these events using the options object which is a attribute on the react <Hammer>
element.
For example, to activate the pinch
event on a canvas
element:
<Hammer
onPinch={handlePinch}
options={{
recognizers: {
pinch: { enable: true }
}
}}>
<canvas></canvas>
</Hammer>
Disabled events are detailed in the hammer.js api documentation:
MIT Licensed. Copyright (c) Jed Watson 2016.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 5/27 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
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-16
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