useElementVisibility

Tracks the visibility of an element within the viewport.

Demo

Is visible boolean bottom right

Scroll down

Usage

const [const ref: Kaioken.MutableRefObject<T | null>ref, const isVisible: booleanisVisible] = useElementVisibility<Element>(): readonly [Kaioken.MutableRefObject<Element | null>, boolean]useElementVisibility()