Released use-right-click

2025-12-31

I recently released a new npm package called use-right-click.

It’s a very small and simple hook that lets you intercept and replace right-click behavior.


Why I made this

In many applications, you often want to treat:

  • Right-click on desktop
  • Long-press on mobile

as the same interaction.

However, implementing this usually means manually wiring multiple DOM events for each component — and that gets tedious very quickly.

When I looked around, I was surprised that there wasn’t a small, focused package that simply handled this case.

So I decided to make one.


About the package

use-right-click is intentionally minimal.

It does one thing:

Unify right-click and long-press into a single, clean interaction.

If it saves you even a little time, I’d be very happy 😊

Feel free to use it.