A minimal JavaScript library for recognizing swipe, pan, tap, doubletap, longpress, pinch, and rotate gestures.
TinyGesture is a very small JavaScript library that recognizes common touch and mouse gestures like swipe, pan, tap, doubletap, longpress, pinch, and rotate. It solves the problem of adding intuitive gesture controls to web applications without the overhead of larger frameworks, providing a minimal and performant solution.
Frontend developers building interactive web applications that require gesture support, especially those targeting mobile devices or touch-enabled interfaces.
Developers choose TinyGesture for its minimal footprint, straightforward API, and comprehensive gesture coverage, allowing them to implement complex interactions with minimal code and no external dependencies.
Very small gesture recognizer for JavaScript. Swipe, pan, tap, doubletap, longpress, pinch, and rotate. (Mirror of https://forge.sciactive.com/sciactive/tinygesture)
The library is very small with minimal overhead, making it ideal for performance-critical web applications without adding bloat, as emphasized in its philosophy of simplicity.
Covers all common gestures including swipe, pan, tap, doubletap, longpress, pinch, and rotate, with clear event separation and properties like scale and rotation for multi-touch.
Uses straightforward event listeners (e.g., gesture.on('swipeleft', callback)) and provides real-time data such as velocityX and swipingDirection, easing integration into custom code.
Supports both touch and mouse events with the mouseSupport option, enabling gesture recognition on desktop and mobile devices without extra configuration.
Uses passive event listeners, preventing developers from calling event.preventDefault() to manage default browser behavior, which can be restrictive for certain interactions like preventing scroll during pans.
Handling scenarios like distinguishing long press from tap requires manual flag management, as shown in the README example, adding complexity for common use cases.
Upgrades, such as from v2 to v3, introduce breaking changes like altered diagonalLimit behavior and new events, which can disrupt existing implementations without careful migration.
Super tiny size multi-touch gestures library for the web. You can touch this →
Detect if a device is mouseOnly, touchOnly, or hybrid, and if the primary input is mouse or touch.
Track mouse/touch/pointer events for a given element.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.