Components
← All components

Idle Detector

stimeo--idle

Fires idle after a span of no interaction (with an optional earlier prompt) and active on return.

The stimeo--idle controller watches document-level user activity (mousemove, keydown, scroll, …, plus returning to a visible tab) and, after timeout ms with none, marks the element data-idle and dispatches stimeo--idle:idle. An optional stimeo--idle:prompt fires promptBefore ms earlier so the app can warn before a hard timeout (supporting WCAG 2.2.1). Any activity re-arms the clock, and while idle or prompting the next interaction dispatches stimeo--idle:active and clears data-idle. Activity is observed on the document with capture + passive so non-bubbling events like scroll are seen anywhere. Behavior only — it renders no warning UI (pair with Dialog / Confirm) and never touches the server session; timers and listeners are torn down on disconnect (Turbo navigation included). Place one on the root element and use data-turbo-permanent to keep the count across visits.

running

Stop interacting with the page: a warning shows after 3s and the idle state after 6s. Move the mouse or press a key to return to active.