All Projects → AvraamMavridis → React Intersection Visible Hook

AvraamMavridis / React Intersection Visible Hook

React Hook to track the visibility of a functional component

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to React Intersection Visible Hook

Scripthookvdotnet
An ASI plugin for Grand Theft Auto V, which allows running scripts written in any .NET language in-game.
Stars: ✭ 679 (+1376.09%)
Mutual labels:  hook
React Cool Inview
😎 🖥️ React hook to monitor an element enters or leaves the viewport (or another element).
Stars: ✭ 830 (+1704.35%)
Mutual labels:  hook
Silence
A simple, clean macro recorder written in C#. Windows 10 compatible.
Stars: ✭ 29 (-36.96%)
Mutual labels:  hook
Use Places Autocomplete
😎 📍 React hook for Google Maps Places Autocomplete.
Stars: ✭ 739 (+1506.52%)
Mutual labels:  hook
Robotgo
RobotGo, Go Native cross-platform GUI automation @vcaesar
Stars: ✭ 7,095 (+15323.91%)
Mutual labels:  hook
Use Measure
It's just a React hook for resize-observer, uses resize-observer-polyfill.
Stars: ✭ 24 (-47.83%)
Mutual labels:  hook
Hyperdbg
The Source Code of HyperDbg Debugger 🐞
Stars: ✭ 658 (+1330.43%)
Mutual labels:  hook
Yahfa
Yet Another Hook Framework for ART
Stars: ✭ 995 (+2063.04%)
Mutual labels:  hook
Droidplugin
A plugin framework on android,Run any third-party apk without installation, modification or repackage
Stars: ✭ 6,683 (+14428.26%)
Mutual labels:  hook
Winproject
Hook, DLLInject, PE_Tool
Stars: ✭ 27 (-41.3%)
Mutual labels:  hook
Interposekit
A modern library to swizzle elegantly in Swift.
Stars: ✭ 777 (+1589.13%)
Mutual labels:  hook
Use Web Animations
😎 🍿 React hook for highly-performant and manipulable animations using Web Animations API.
Stars: ✭ 802 (+1643.48%)
Mutual labels:  hook
Stinger
Stinger is a high-efficiency library with great compatibility, for aop in Objective-C, using libffi instead of Objective-C message forwarding. It is 20+ times faster than the Aspects, from message-sending to Aspect-oriented code ends.
Stars: ✭ 845 (+1736.96%)
Mutual labels:  hook
Fakerandroid
A tool translate a apk file to stantard android project include so hook api and il2cpp c++ scaffolding when apk is a unity il2cpp game. Write code on a apk file elegantly.
Stars: ✭ 695 (+1410.87%)
Mutual labels:  hook
Gameoverlay
🎮 GameOverlay using CEF with support for common rendering backends
Stars: ✭ 32 (-30.43%)
Mutual labels:  hook
Virtuallocation
利用Hook技术对APP进行虚拟定位,可修改微信、QQ、以及一些打卡APP等软件,随意切换手机所处位置!
Stars: ✭ 666 (+1347.83%)
Mutual labels:  hook
React Use Form State
📄 React hook for managing forms and inputs state
Stars: ✭ 898 (+1852.17%)
Mutual labels:  hook
Xposednavigationbar
Xposed导航栏功能拓展模块
Stars: ✭ 42 (-8.7%)
Mutual labels:  hook
Kirby Autofocus
Content aware image cropping for Kirby. Kirby 2 and 3.
Stars: ✭ 35 (-23.91%)
Mutual labels:  hook
Proxychains Ng
proxychains ng (new generation) - a preloader which hooks calls to sockets in dynamically linked programs and redirects it through one or more socks/http proxies. continuation of the unmaintained proxychains project. the sf.net page is currently not updated, use releases from github release page instead.
Stars: ✭ 7,553 (+16319.57%)
Mutual labels:  hook

react-intersection-visible-hook

React hook to track the visibility of a functional component based on IntersectionVisible Observer.

In the following example we changed the background color of the body depending on the visibility of the blue box.

Demo and tests are coming

import useVisibility from 'react-intersection-visible-hook'

How to use it

function App() {
  const nodeRef = useRef(null);
  const visibility = useVisibility(nodeRef);

  return (
    <div className="App" ref={nodeRef}>
      <h1>Hello</h1>
    </div>
  );
}
With options
const options = {
  root: document.querySelector('#scrollArea'),
  rootMargin: '0px',
  threshold: 1.0
}

function App() {
  const nodeRef = useRef(null);
  const visibility = useVisibility(nodeRef, options);

  return (
    <div className="App" ref={nodeRef}>
      <h1>Hello</h1>
      <h2>{visibility.isIntersecting ?  'Component is visible' : 'Component is hidden' }</h2>
    </div>
  );
}

The visibility object contains

boundingClientRect
intersectionRatio
intersectionRect
isIntersecting
rootBounds
target
time

Contribute

Any pull-request is more than welcome 💥 😄

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].