SHIFT + D

Press

Updated on September 20, 2024Source codeTests

usePress is an extension that tracks when an element has been pressed or released. It behaves consistently across browsers and devices, and it supports various inputs, including mouse, touch, and keyboard.

usePress gives you a reactive reference to all of the rich metadata captured by the keypress, mousepress, and touchpress tools from Baleada Logic, which it uses internally.

Example

Example source code

Press anywhere to start, or use Tab to focus the element, and Enter or Space to descriptor.

0ms
0.0px/ms

Metadata used in this example includes press duration, velocity, and angle.

PopupRendering

Edit doc on GitHub

ON THIS PAGE

PressExample