pointeract
v1.2.0
Published
A 3KB, tree-shakable, TypeScript-native human interaction library for robust tap/pan/zoom gestures — runtime-flexible and extensible.
Downloads
878
Maintainers
Readme
Get Started
Install Pointeract using your favorite package manager:
# npm
npm add pointeract
# pnpm
pnpm add pointeract
# yarn
yarn add pointeract
# bun
bun add pointeractOr 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
- Swipe (All directions, single / multiple fingers)
- Pan and Zoom via Mouse Wheel (
ctrl/shiftkey 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!
Copyright and License
Copyright ©️ 2025-2026 Hesprs (Hēsperus) | Apache License 2.0
