MCPcopy
hub / github.com/thebuilder/react-intersection-observer / IntersectionOptions

Interface IntersectionOptions

src/index.tsx:29–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29export interface IntersectionOptions extends IntersectionObserverInit {
30 /** The IntersectionObserver interface's read-only `root` property identifies the Element or Document whose bounds are treated as the bounding box of the viewport for the element which is the observer's target. If the `root` is null, then the bounds of the actual document viewport are used.*/
31 root?: Element | Document | null;
32 /** Margin around the root. Can have values similar to the CSS margin property, e.g. `10px 20px 30px 40px` (top, right, bottom, left). */
33 rootMargin?: string;
34 /** Number between `0` and `1` indicating the percentage that should be visible before triggering. Can also be an `array` of numbers, to create multiple trigger points. */
35 threshold?: number | number[];
36 /** Only trigger the inView callback once */
37 triggerOnce?: boolean;
38 /** Skip assigning the observer to the `ref` */
39 skip?: boolean;
40 /** Set the initial value of the `inView` boolean. This can be used if you expect the element to be in the viewport to start with, and you want to trigger something when it leaves. */
41 initialInView?: boolean;
42 /** Fallback to this inView state if the IntersectionObserver is unsupported, and a polyfill wasn't loaded */
43 fallbackInView?: boolean;
44 /** IntersectionObserver v2 - Track the actual visibility of the element */
45 trackVisibility?: boolean;
46 /** IntersectionObserver v2 - Set a minimum delay between notifications */
47 delay?: number;
48 /** Call this function whenever the in view state changes */
49 onChange?: (inView: boolean, entry: IntersectionObserverEntry) => void;
50}
51
52export interface IntersectionObserverProps extends IntersectionOptions {
53 /**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…