--- title: useIdle description: "`useIdle` is a custom hook that detects whether the user has been idle for a certain amount of time in milliseconds." links: - source: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/hooks/use-idle - storybook: https://yamada-ui.github.io/yamada-ui?path=/story/hooks-useidle--basic --- ```tsx const idle = useIdle(2000) return Current state: {idle ? "idle" : "not idle"} ``` ## Usage ```tsx import { useIdle } from "@yamada-ui/react" ``` ```tsx import { useIdle } from "@/components/ui" ``` ```tsx import { useIdle } from "@workspaces/ui" ``` ```tsx const idle = useIdle(2000) ```