Hooks · hook · 4K

useIdle

Tells you when the user has been idle for a given time. Passive pointer, key, wheel and touch listeners only write a timestamp and one timer re-checks, so moving the mouse never churns timers. Never goes idle in a hidden tab; a canIdle veto, reset() and activate().

Install

pnpm dlx shadcn@latest add @s7ui/use-idle

Info

Files:
hooks/use-idle.ts
Uses:
—
Packages:
—