Skip to content

feat: add useElementExposure hook#141

Open
umer901 wants to merge 1 commit into
DavidHDev:mainfrom
umer901:feat/102-useElementExposure-hook
Open

feat: add useElementExposure hook#141
umer901 wants to merge 1 commit into
DavidHDev:mainfrom
umer901:feat/102-useElementExposure-hook

Conversation

@umer901

@umer901 umer901 commented Dec 7, 2025

Copy link
Copy Markdown

Description

Adds #102 useElementExposure hook that tracks how long a user has spent actively viewing a specific element. For issue

Features

  • Returns exposureSeconds: number
  • Pauses timer when tab/element is hidden
  • Uses IntersectionObserver + Page Visibility API
  • Configurable visibility threshold

Note: The visibility percentage indicates how much of the element should be visible for the timer to not reset.

Demo

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant