Akryum/vue-observe-visibility — an open-source project — sits at 1.6k GitHub stars. Detect when an element is becoming visible or hidden on the page.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Detect when an element is becoming visible or hidden on the page. Demo
Sponsors
Table of contents
Installation
Usage
Example
Installation
npm install --save vue-observe-visibility
⚠️ This plugin uses the Intersection Observer API that is not supported in every browser (currently supported in Edge, Firefox and Chrome). You need to include a polyfill to make it work on incompatible browsers.
Import
import Vue from 'vue'
import VueObserveVisibility from 'vue-observe-visibility'
Vue.use(VueObserveVisibility)
Or:
import Vue from 'vue'
import { ObserveVisibility } from 'vue-observe-visibility'
Vue.directive('observe-visibility', ObserveVisibility)
The function will be called whenever the visiblity of the element changes with the argument being a boolean (true means the element is visible on the page, false means that it is not).
The second argument is the corresponding IntersectionObserverEntry object.
You can use the throttle options (in ms) specifying minimal state duration after which an event will be fired. It's useful when you are tracking visibility while scrolling and don't want events from fastly scrolled out elements.
You can also pass a leading option to trigger the callback the first time when the visibility changes without waiting for the throttle delay.
I can either be visible, hidden or both.
TopGit's metadata for Akryum/vue-observe-visibility does not record a license. Most public repositories on GitHub ARE open source, but the exact terms vary — verify by opening the LICENSE file directly.
What is Akryum/vue-observe-visibility?
Akryum/vue-observe-visibility (Akryum/vue-observe-visibility) is a JavaScript project on GitHub. From the project's own README: Detect when an element is becoming visible or hidden on the page.
Where do I read more about Akryum/vue-observe-visibility?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/Akryum/vue-observe-visibility is the definitive source.
Read full README in the tab above.
Is vue-observe-visibility worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of vue-observe-visibility.