Interface IUseInViewportProps

Hierarchy

Properties

destroyOnIn?: boolean

If true, destroys the observer instance when the element appears in the viewport

isDisabled?: boolean

If true, disables the intersection observer.

Default

false
onIn?: (() => void)

Type declaration

    • (): void
    • Callback triggered when the element enters the viewport

      Returns void

onOut?: (() => void)

Type declaration

    • (): void
    • Callback triggered when the element exits the viewport

      Returns void

ref: THookEventElement<Element>

Observable element

root?: null | Document | Element

The root element used for the intersection calculation.

Default

null
rootMargin?: string

The margin around the root.

Default

'0px 0px 0px 0px'
threshold?: number | number[]

The threshold(s) at which to trigger the callback.

Default

0