Boost Click Speed In JavaScript – Clickdown

Category: Javascript | April 23, 2025
Authorvictrme
Last UpdateApril 23, 2025
LicenseMIT
Tags
Views52 views
Boost Click Speed In JavaScript – Clickdown

Clickdown is a tiny JavaScript/TypeScript library that makes clicks feel faster by combining the immediacy of pointerdown events with the functionality of click events.

It accelerates response times and improves the user experience on various clickable elements such as links, checkboxes, and radio buttons.

How to use it:

1. Download and import the Clickdown library into your project.

# NPM
$ npm i clickdown
import 'clickdown'

2. Attach the `onclickdown` event to any clickable elements, such as links, checkboxes, or radio buttons. That’s it.

document.getElementById('cliableElement').onclickdown(function (event, target) {
  console.log(event) // PointerEvent
  console.log(target) // <input type="..." />
},{
  propagate: true, // or false
})

Changelog:

v1.3.4 (04/23/2025)

  • Update

v1.2.2 (08/17/2024)

  • Add <details> behavior & propagate option

You Might Be Interested In:


Leave a Reply