https://github.com/hesprs/pointeract
π±οΈπ€ Library for multitouch and all other gestures.
https://github.com/hesprs/pointeract
frontend interaction pointer-events typescript
Last synced: 8 days ago
JSON representation
π±οΈπ€ Library for multitouch and all other gestures.
- Host: GitHub
- URL: https://github.com/hesprs/pointeract
- Owner: hesprs
- License: apache-2.0
- Created: 2025-12-14T11:22:49.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-01-30T17:47:09.000Z (11 days ago)
- Last Synced: 2026-01-31T10:15:28.379Z (11 days ago)
- Topics: frontend, interaction, pointer-events, typescript
- Language: TypeScript
- Homepage: https://pointeract.consensia.cc
- Size: 993 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
Modern, lightweight, robust and extensible user interaction resolver
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 have 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?](https://pointeract.consensia.cc/development/testing#monkey-test)
- **π§© 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:
```sh
# npm
$ npm add pointeract
# pnpm
$ pnpm add pointeract
# yarn
$ yarn add pointeract
# bun
$ bun add pointeract
```
Or include the following lines directly in your HTML file:
```html
import { Pointeract } from 'https://unpkg.com/pointeract/dist/index.js';
```
This link ships the latest ESM version by default, to access CJS version or earlier versions, try using a different URL like:
```html
```
The link above ships version 1.0.1 in CJS.
Then simply grab the core class and a module:
```TypeScript
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](https://pointeract.consensia.cc/basic/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](https://pointeract.consensia.cc/development/custom-modules)!
## 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](https://hammerjs.github.io) | [Interact.js](https://interactjs.io) |
| :--------------------------------------------------------------------------------------- | :---------------------------------------------------: | :----------------------------------------------: | :-------------------------------------------------: |
| Written in TypeScript? | β
| β | β
|
| Tree-shakeable? | [β
](https://bundlephobia.com/package/pointeract) | [β](https://bundlephobia.com/package/hammerjs) | [β](https://bundlephobia.com/package/interactjs) |
| Bundle Size (Minified + Gzipped) | π [3KB](https://bundlephobia.com/package/pointeract) | [7KB](https://bundlephobia.com/package/hammerjs) | [28KB](https://bundlephobia.com/package/interactjs) |
| Last Updated | π Actively Maintained | 2015 | 2023 |
| Features | Pointer and Wheel Related | Pointer Related | π Pointer and Wheel Related + Comprehensive Utils |
| Robust? (See [Testing](https://pointeract.consensia.cc/development/testing#monkey-test)) | β
| β Element Jerks | β Element Ignores the Second Touch |
| Extensible? | β
| β | β |
## Get Involved
This project welcomes anyone that have ideas to improve it.
- [Open a pull request](https://github.com/hesprs/pointeract/compare) for a new module, event standard, documentation update, and so on.
- [Open an issue](https://github.com/hesprs/pointeract/issues/new) if you find a bug.
- [Start a new thread in Discussions](https://github.com/hesprs/pointeract/discussions/new) if you have feature requests or questions, please avoid posting them in Issues.
- [Report a vulnerability](https://github.com/hesprs/pointeract/security/advisories/new) if you find one, please do not disclose it publicly.
## Copyright and License
Copyright Β©οΈ 2025-2026 Hesprs (HeΜsperus) | [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0.html)