Skip to content

πŸ–±οΈπŸ€ Modern, lightweight, robust and extensible user gesture recognizer.

License

Notifications You must be signed in to change notification settings

hesprs/pointeract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

33 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

modern, lightweight, robust and extensible user gesture recognizer

CI Status Test Coverage Code Quality Documentation npm package library security package size Typescript Made by Humans

Demo β€’ Documentation β€’ npm

What's Pointeract?

Pointeract is a tiny JavaScript/TypeScript utility library focusing on one thing - handling user interactions with DOM elements, e.g. multitouch and touchpad.

With the unique strength of versatile typings in TypeScript and its dynamic nature, Pointeract has achieved a highly modular, extendable and efficient architecture. Its core bundle size is only 1KB minified + gzipped, functionalities come from also byte-sized modules. It's fully tree-shakable, the fewer modules you use, the smaller your bundle is.

Advantages

  • 🐣 Tiny: With base 1KB minified and gzipped, 1-2KB for normal usage.
  • πŸ’ͺ Robust: Excels at complex gestures where most interaction libraries fail, Why?
  • 🧩 Extensible: Extend Pointeract effortlessly via our module API.
  • πŸ”Œ Flexible during Runtime: Options are updated reactively. Stop/start any module during runtime.
  • πŸ›‘οΈ Safe: Not modifying the DOM (except the PreventDefault module). Meticulous clean up prevents memory leaks.

Get Started

Install Pointeract using your favorite package manager:

# npm
$ npm add pointeract

# pnpm
$ pnpm add pointeract

# yarn
$ yarn add pointeract

Or include the following lines directly in your HTML file:

<script type="module">
	import { Pointeract } from 'https://unpkg.com/pointeract';
</script>

This link ships the latest ESM version by default.

Then simply grab the core class and a module:

import { Pointeract, Drag } from 'pointeract';

new Pointeract({ element: yourElement }, Drag)
    .start()
    .on('drag', e => console.log(e));

Congratulations! You can now press your mouse or finger to the element and move, the console will log events like a waterfall.

Read next: dive into the usage of Pointeract in Use Pointeract.

Currently Supported Features

  • Click (Double Click, Triple Click, Quadruple Click, Any Click)
  • Drag
  • Pan and Zoom via Mouse Wheel (ctrl/shift key binding, touchpad support)
  • Pan and Zoom via Multitouch (Pan, Pinch)
  • One-line Prevent Default
  • Smooth Everything (drag / pan / zoom / any interaction involving numbers)

Those interactions are shipped via modules, which can be composed from a single drag-and-drop to a canvas app.

Missing your desired interaction? Write your own module!

How Pointeract Stands Out?

There're already plenty of interaction libraries out there, most famous ones are Interact.js and Hammer.js, but Pointeract is different.

Criteria Pointeract Hammer.js Interact.js
Written in TypeScript? βœ… ❌ βœ…
Tree-shakeable? βœ… ❌ ❌
Total Bundle Size (Minified + Gzipped) πŸ‘‘ 3KB 7KB 28KB
Last Updated πŸ‘‘ Actively Maintained 2015 2023
Features Pointer and Wheel Related + Some Utils Pointer Related πŸ‘‘ Pointer and Wheel Related + Comprehensive Utils
Robust? (See Testing) βœ… ❌ Element Jerks ❌ Element Ignores the Second Touch
Extensible? βœ… ❌ ❌

Get Involved

This project welcomes anyone that has ideas to improve it.

Copyright and License

Copyright ©️ 2025-2026 Hesprs (HeΜ„sperus) | Apache License 2.0

About

πŸ–±οΈπŸ€ Modern, lightweight, robust and extensible user gesture recognizer.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Contributors 2

  •  
  •