Back to Marketplace
Open Source

mousepad.js

Pointer intelligence for the web. mousepad.js unifies gestures (tap, double-tap, long-press, swipe, pan, pinch, rotate), cursor effects (magnet, 3D tilt, follow), precise trackpad detection, and idle tracking across mouse, touch, pen, and trackpad — on top of Pointer Events in 2.9KB gzipped with zero dependencies and strict TypeScript types.

TypeScriptPointer EventsGesturesTrackpad DetectionMagnetic Buttons3D Tilt CardsCursor EffectsIdle DetectionZero DependenciesESM + UMDOpen SourceMIT License

The Problem

Challenge

Modern web apps juggle mouse, trackpad, touch, and pen — but the tooling hasn't kept up. Hammer.js is abandoned, interact.js is heavy and opinionated, use-gesture is React-only, and the browser gives you no way to tell a mouse wheel from a trackpad swipe or a pinch-to-zoom from a scroll. Teams reinvent gesture detection, cursor effects, and input-type heuristics in every project — usually badly, and never with a single consistent event model. What was missing: a tiny, framework-agnostic library built on Pointer Events that handles the full input picture, including trackpad nuance.

Our Approach

Strategy

We built mousepad.js on the unified Pointer Events API so every gesture — tap, double-tap, long-press, swipe, pan, pinch, rotate — works identically across mouse, trackpad, touch, and pen. For cursor effects, `MousePad.magnet` pulls buttons toward the cursor with spring easing, `MousePad.tilt` gives cards 3D rotation with a radial spotlight (pure CSS transforms, GPU-composited), and `MousePad.follow` runs a smooth trailing cursor. The trackpad detector inspects `WheelEvent.deltaMode` and delta granularity to distinguish mouse wheels from trackpad swipes, and surfaces pinch-to-zoom as a separate typed event. A global cursor tracker emits `move`, `idle`, and `active` events for auto-hiding chrome (video controls, UI overlays). The landing page is a live playground: move the cursor to see trail + velocity + input kind detection in real time, gesture any element with a streaming event console, and hover magnetic buttons backed by spring physics.

The Solution

Result

A 2.9KB gzipped, MIT-licensed pointer library with zero runtime dependencies. Ships ESM, UMD, and full TypeScript declarations. One API (`MousePad`) covers gestures, magnetic buttons, 3D tilt cards, trackpad detection, idle detection, and a global cursor stream. Deployed on Vercel at mousepadjs.techzunction.com with a self-hosting documentation site that exercises every feature — gestures, trackpad detection, 3D tilt cards, magnetic CTAs, idle state — directly in the browser.

Screenshots

Product Gallery

mousepad.js hero — v1.0.0 · 2.9KB gzip · 0 dependencies · TypeScript-first · MIT license with live cursor trail showing trackpad input kind, velocity 1042 px/s, and active state
mousepad.js usage example — npm install, MousePad.gesture with tap/doubletap/longpress/swipe/pan/pinch/rotate, plus magnet/tilt/follow cursor utilities
Gestures demo — tap, double-tap, long-press, swipe (flick fast), pan (drag) all working on the same element across trackpad, touch, and pen
Magnetic buttons + 3D tilt cards — Get Started / Documentation / Examples / Changelog with spring-easing magnet, plus feature cards (Pointer Events, Tiny, Typed, Zero deps)
Trackpad detection + idle detection + event console — WheelEvent.deltaMode distinguishes wheel vs trackpad, pinch zoom is a separate event, idle flips after 2s

Live Demos

See It in Action

Full Walkthrough

Key Metrics

0.9KB

Gzipped

0

Dependencies

0

Gestures

MIT

License

Get This Product

mousepad.js

Complete source code, assets, and deployment-ready build

$10USD / one-time

Exclusive Ownership

Secure payment via Razorpay. Instant delivery.

mousepad.js

$10