useElementVisibility

Tracks the visibility of an element within the viewport.

Demo

Is visible boolean bottom right

Scroll down

Usage

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