useIdleVisibility – Idle Detection + Visibility Hook for React
Overview
Combines page-visibility with idle detection. Listens for mousemove, keydown, pointerdown, scroll, and touchstart events. After timeout ms of inactivity the user is marked as idle. The idle timer resets when the tab becomes visible again.