Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. JavaScript
  3. hammer.js

hammer.js

MITJavaScript

A JavaScript library for detecting and recognizing multi-touch gestures on web applications.

Visit WebsiteGitHubGitHub
24.4k stars2.6k forks0 contributors

What is hammer.js?

Hammer.js is a JavaScript library that detects and recognizes multi-touch gestures in web applications. It solves the problem of adding intuitive touch interactions to websites and web apps, enabling gestures like taps, swipes, and pinches without native browser support complexities.

Target Audience

Frontend developers building touch-enabled web applications, especially for mobile devices or interactive web interfaces.

Value Proposition

Developers choose Hammer.js for its simplicity, lightweight footprint, and flexibility in handling both built-in and custom gestures with a clean API.

Overview

A javascript library for multi-touch gestures :// You can touch this

Use Cases

Best For

  • Adding swipe navigation to mobile web apps
  • Implementing pinch-to-zoom in web-based image viewers
  • Creating interactive touch-based games for browsers
  • Building custom gesture controls for data visualization dashboards
  • Enhancing mobile web forms with gesture-based interactions
  • Developing touch-friendly UI components for cross-platform web applications

Not Ideal For

  • Applications built with modern frameworks like React or Vue that have integrated gesture libraries (e.g., Framer Motion, vue-touch)
  • Projects requiring out-of-the-box gesture animations and visual feedback, as Hammer.js only handles detection, not styling
  • High-performance gaming or VR applications needing low-latency, hardware-accelerated input handling beyond basic gestures
  • Accessibility-first projects where gesture support must be deeply integrated with keyboard navigation and ARIA roles without extra setup

Pros & Cons

Pros

Wide Gesture Support

Recognizes common multi-touch gestures like tap, swipe, pinch, and rotate out of the box, as listed in the key features, reducing boilerplate code.

Custom Gesture Flexibility

Allows defining and configuring custom gestures, such as tripletap with configurable taps, using the manager-based API shown in the README example.

Lightweight and Performant

Designed with minimal overhead for mobile web apps, ensuring fast gesture detection without significant performance hits on touch-enabled devices.

Quick Start API

Offers simple event subscriptions for common gestures, enabling rapid integration with just a few lines of code, as demonstrated in the quick start example.

Cons

No Built-in Visuals

Only handles gesture detection; developers must implement CSS or JavaScript separately for animations and visual feedback, adding development complexity.

Documentation Gaps

The README links to external documentation, and some example links (e.g., for pinch and rotate) are empty, indicating potential incomplete or outdated resources.

Complex Custom Setup

Defining custom gestures requires multiple steps with managers and recognizers, which can be cumbersome compared to simpler gesture libraries or native APIs.

Frequently Asked Questions

Quick Stats

Stars24,355
Forks2,582
Contributors0
Open Issues285
Last commit3 months ago
CreatedSince 2012

Tags

#multi-touch#mobile-web#frontend#javascript-library#touch-gestures#web-development#event-handling

Built With

J
JavaScript

Links & Resources

Website

Included in

JavaScript34.9k
Auto-fetched 1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub