From e2d659cc8ea2d90e86b0ccea99ae6aff9ad24155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Fri, 27 Nov 2026 13:36:22 +0000 Subject: [PATCH] docs: document scrollMargin option in IntersectionObserver --- docs/global-intersectionobserver.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/global-intersectionobserver.md b/docs/global-intersectionobserver.md index afa3dc70053..fba549a78da 100644 --- a/docs/global-intersectionobserver.md +++ b/docs/global-intersectionobserver.md @@ -42,6 +42,7 @@ An optional object with the following properties: | -------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `root` | [Element](element-nodes) \| null | An element that is an ancestor of the target, whose bounding rectangle will be considered the viewport. Defaults to the root viewport if not specified or if `null`. | | `rootMargin` | string | A string which specifies a set of offsets to add to the root's bounding box when calculating intersections. Defaults to `"0px 0px 0px 0px"`. | +| `scrollMargin` | string | A string which specifies a set of offsets to add to the clipping box of every scroll container between the root and the target when calculating intersections. Defaults to `"0px 0px 0px 0px"`. | | `threshold` | number \| number[] | Either a single number or an array of numbers between 0.0 and 1.0, specifying a ratio of intersection area to total bounding box area for the observed target. Defaults to `[0]` if `rnRootThreshold` is not set. | | `rnRootThreshold` ⚠️ | number \| number[] | **React Native specific.** Either a single number or an array of numbers between 0.0 and 1.0, specifying a ratio of intersection area to the total root area. | @@ -73,6 +74,12 @@ Notifications for a target are generated when any of the thresholds specified in get rnRootThresholds(): ReadonlyArray | null; ``` +### `scrollMargin` + +See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/scrollMargin). + +An offset rectangle applied to the clipping box of every scroll container between the root and the target when calculating intersections. Unlike `rootMargin`, it doesn't change the root's bounding box, so it doesn't affect the reported `rootBounds`. + ### `thresholds` See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/thresholds).