Skip to main content
Version: 57.2.0

UserInactivity

A component that detects user inactivity by monitoring touch events and keyboard interactions. When the user hasn't interacted with the app for a specified duration, it triggers a callback. This is useful for implementing session timeouts, auto-logout features, or any functionality that depends on user activity state. No demo is available as this component requires app-level integration.

Package: @terreno/ui
Categories: Component
Props interface: UserInactivityProps
Story source: demo/stories/UserInactivity.stories.tsx

Live demo

Props

PropTypeRequiredDescription
childrenReactNodeYesChildren components to embed inside UserInactivity's View. If any children component is pressed,
onActionreflectionYesCallback triggered anytime UserInactivity's View isn't touched for more than
isActivebooleanIf it's explicitly set to
skipKeyboardbooleanIf set to true, the timer is not reset when the keyboard appears or disappears.
styleStylePropOptional custom style for UserInactivity's View.
timeForInactivitynumberNumber of milliseconds after which the view is considered inactive. If it changed, the timer restarts and the view is considered active until the new timer expires.