useIdle
User inactivity timeout monitor.
1 KB
•Updated on September 3, 2026
Installation
Bash
pnpm dlx shadcn@latest add @spaceui/hooks-lifecycle-use-idleUsage
Code
import { useIdle } from '@/hooks/use-idle'
const isIdle = useIdle(5000)API Reference
Parameters / Props
| Parameter | Type | Default | Description |
|---|---|---|---|
timeout | number | 60000 | Idle threshold in ms. |
Return Value
| Return Type | Description |
|---|---|
boolean | True if idle. |