DEV Community

Aleksei Aleinikov
Aleksei Aleinikov

Posted on

πŸ–± Click or Hold? This CSS Trick Gives You Two Actions in One Button ⚑

No extra icons. No messy timers. Just pure CSS + 2 tiny JS hooks to reliably detect short vs long press β€” click for the main action, hold for hidden superpowers.

Perfect for galleries, maps, to‑do lists, and more.

πŸ‘‰ Hold to Act: a Reliable CSS Pattern (2025)
https://javascript.plainenglish.io/hold-to-act-a-reliable-css-pattern-2025-490b3aeaf22e

Top comments (0)