hammerjs/hammer.js
hammerjs/hammer.js has 24,322 GitHub stars and 2,548 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-04 11:28 UTC. Last push 2026-01-04.
A javascript library for multi-touch gestures :// You can touch this
Measured star growth
- in 24h
- 0
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originalhammer.js

A JavaScript library for detecting touch gestures.
Installation
NPM
npm install --save hammerjs
or
Yarn
yarn add hammerjs
or
CDN
https://cdnjs.com/libraries/hammer.js/
Usage
hammer.js has a quick start option for gestures it already recognizes.
// Get a reference to an element.
var square = document.querySelector('.square');
// Create an instance of Hammer with the reference.
var hammer = new Hammer(square);
// Subscribe to a quick start event: press, tap, or doubletap.
// For a full list of quick start events, read the documentation.
hammer.on('press', function(e) {
e.target.classList.toggle('expand');
console.log("You're pressing me!");
console.log(e);
});
If you want to recognize your own gestures, such as tripletap, then you'll have to use these steps:
// Get a reference to an element.
var square = document.querySelector('.square');
// Create a manager to manage the element.
var manager = new Hammer.Manager(square);
// Create a recognizer.
var TripleTap = new Hammer.Tap({
event: 'tripletap',
taps: 3
});
// Add the recognizer to the manager.
manager.add(TripleTap);
// Subscribe to the event.
manager.on('tripletap', function(e) {
e.target.classList.toggle('expand');
console.log("You're triple tapping me!");
console.log(e);
});
Examples
Documentation
For further information regarding hammer.js, please read our documentation.
Contributions

Feel encouraged to report issues or submit pull requests. When you're ready to do either, read our contribution guidelines. If you're looking for another form of contribution, we love help answering questions on our slack channel.
License
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
559,853 starspublic-apis/public-apis
A collective list of free APIs
496,131 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
430,915 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
393,919 stars