npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@artcom/react-tap-tolerance

v0.2.0

Published

React hook that keeps taps clicking on imprecise touch hardware by tolerating small pointer movement.

Readme

@artcom/react-tap-tolerance

A React hook that keeps taps clicking on imprecise touch hardware - IR touch frames, touch foils and similar - where the reported position jitters while a finger rests on the screen. Browsers treat such a press as a tiny drag and drop its click, so buttons feel unresponsive. This hook fills in the missing clicks.

Installation

npm install @artcom/react-tap-tolerance

Usage

Call the hook once near the root of your app. Every onClick in the app benefits; no per-component changes are needed.

import { useTapTolerance } from "@artcom/react-tap-tolerance"

function App() {
  useTapTolerance()

  return <YourApp />
}

useTapTolerance(options?)

| Option | Type | Default | Description | | ----------------- | --------- | ------- | ----------------------------------------------------------------------------- | | threshold | number | 100 | Max distance in CSS pixels a pointer may travel from its start and still tap. | | scrollThreshold | number | 30 | Max distance for a press the browser turned into a scroll (see below). | | pinchZoom | boolean | false | Allow two-finger pinch-zoom on the page. |

How it works

For every pointer (touch, pen or mouse) the hook remembers where it went down and on which element.

  • If the pointer ever moves further than threshold, the press is a drag and never produces a click from the hook - even if it comes back.
  • On release, the hook waits a frame. If the browser delivered its own click for the press, nothing happens. Otherwise the hook dispatches a click on the element the press started on.
  • If the browser clicks a common ancestor instead (because the pointer drifted onto a neighbouring element), that click is replaced by one on the pressed element. It still bubbles through the ancestor.
  • Presses on disabled or removed elements never click.

Each tap therefore produces exactly one click. Clicks the browser delivers correctly, and keyboard clicks, are left untouched.

Scroll areas

Inside scrollable elements (overflow: auto/scroll) the browser may turn a jittering press into a scroll and cancel the pointer, so it never clicks. The hook keeps following the finger through touch events: if it lifts within scrollThreshold, the pressed element is still clicked. The list may move a few pixels before the click; longer swipes scroll without clicking. Multi-finger gestures, such as a pinch, never click.

touch-action

While mounted, the hook sets touch-action: none on document.body (or pinch-zoom with pinchZoom: true), so jitter doesn't pan the page or trigger browser gestures. Scrolling the page itself is disabled; scroll areas inside the page keep scrolling. The previous value is restored on unmount.

Pinch-zoom is off by default: in a kiosk, a visitor who zooms in leaves the next visitor with no way back.

Development

npm install
npm test
npm run lint
npm run build