Home
Docs
InfinityFX
©Copyright2016-2026 InfinityFX. All rights reserved.
InfinityFX®
Lively
v5.0.0
Getting started
Components
Animate
LayoutGroup
TextAnimation
ViewAnimation
Hooks
useAudio
useHover
useLink
useReducedMotion
useScroll
useSpring
useTap
useViewport
useVisible
Links
v4 docs
llms.txt

useTap

Provides a ref and a reactive boolean state indicating whether the attached element is currently being pressed down by a pointer.

Importing

1
import { useTap } from '@infinityfx/lively/hooks';

Usage

Press me

Call signature

1
const [ref, tapping] = useTap<T extends HTMLElement>()

Returns

ref:React.RefObject<T | null>

A React ref to attach to the target DOM element.

tapping:boolean

A boolean value indicating if the element is currently pressed down.