# hammerjs/hammer.js

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/hammerjs-hammer-js).**

24,387 stars · 2,595 forks · JavaScript · mit

## Links

- GitHub: https://github.com/hammerjs/hammer.js
- Homepage: http://hammerjs.github.io
- awesome-repositories: https://awesome-repositories.com/repository/hammerjs-hammer-js.md

## Description

Hammer.js is a library for recognizing touch gestures in web applications. It functions as a unified interface that translates raw pointer, mouse, and touch inputs into a consistent stream of interaction data, allowing developers to detect patterns such as taps, swipes, and pans across different browsers and hardware.

The library distinguishes itself through a modular architecture that uses configurable logic blocks to evaluate input streams against specific mathematical thresholds. It maintains an internal registry of active touch points to track complex multi-finger movements like pinching and rotating, while a state machine manages the lifecycle of these interactions to determine when a gesture is successfully completed.

Beyond standard interactions, the library supports custom gesture handling and event delegation through the document object model. It provides a comprehensive set of event handlers that abstract away inconsistent input behaviors, enabling the creation of responsive interfaces that interpret finger movements on touch-enabled devices.

## Tags

### User Interface & Experience

- [Touch Gesture Recognition Libraries](https://awesome-repositories.com/f/user-interface-experience/touch-gesture-recognition-libraries.md) — Adds support for complex touch interactions like swipes, pinches, and taps to web applications to improve mobile user experience.
- [Touch Gesture Detectors](https://awesome-repositories.com/f/user-interface-experience/touch-gesture-detectors.md) — Detects touch gestures on interface elements by listening for taps, swipes, and pans while configuring specific settings to match user interaction patterns. ([source](http://hammerjs.github.io/getting-started/))
- [Input Normalization Utilities](https://awesome-repositories.com/f/user-interface-experience/input-normalization-utilities.md) — Translates disparate pointer, mouse, and touch events into a unified stream of interaction data for consistent gesture processing.
- [Touch Gesture Libraries](https://awesome-repositories.com/f/user-interface-experience/touch-gesture-libraries.md) — Translates raw pointer and touch inputs into recognizable interaction patterns like swipes and taps.
- [Gesture Recognition Engines](https://awesome-repositories.com/f/user-interface-experience/gesture-recognition-engines.md) — Provides modular logic blocks that evaluate raw input streams against mathematical thresholds to identify distinct user interaction patterns.
- [Cross-Browser Input Abstractions](https://awesome-repositories.com/f/user-interface-experience/cross-browser-input-abstractions.md) — Provides a unified interface that abstracts away inconsistent touch and mouse event behaviors across different browsers and mobile operating systems.
- [Multi-Touch Tracking Systems](https://awesome-repositories.com/f/user-interface-experience/multi-touch-tracking-systems.md) — Maintains an internal registry of active touch points to calculate complex multi-finger movements like pinching and rotating.
- [Cross-Device Input Handlers](https://awesome-repositories.com/f/user-interface-experience/cross-device-input-handlers.md) — Standardizes touch and pointer event handling across different browsers and hardware to ensure consistent behavior for all users.
- [Pointer Event Abstractions](https://awesome-repositories.com/f/user-interface-experience/pointer-event-abstractions.md) — Maps complex multi-touch sequences into simplified, high-level interaction events for web-based user interfaces.
- [Custom Interaction Patterns](https://awesome-repositories.com/f/user-interface-experience/custom-interaction-patterns.md) — Creates unique input patterns for web applications that require specific touch sequences beyond standard click or scroll events.
- [Interaction State Machines](https://awesome-repositories.com/f/user-interface-experience/interaction-state-machines.md) — Tracks the lifecycle of user interactions through discrete states to determine when a specific gesture pattern is successfully completed.

### Web Development

- [Mobile Web Interaction Libraries](https://awesome-repositories.com/f/web-development/mobile-web-interaction-libraries.md) — Builds responsive interfaces that feel natural on touch-enabled devices by capturing and interpreting finger movements on the screen.
