Above the Fold Functions

isInFirstFold()

Checks whether a component is above the fold on the current page.

Use it to decide what to load or render first, such as loading an image right away when it's above the fold and lazily when it isn't.

Returns undefined for a component that isn't marked, and never throws. Treat anything other than true as not above the fold.

The result describes the page's initial layout, not where the site visitor has scrolled to. This value doesn't change for the lifetime of the page. The method does the same lookup while the page renders on the server and in the browser.

The result is based on the page's layout, not on the site visitor's screen size, so use it to prioritize loading, not to tell whether a component is visible.

Method Declaration

Copy

Method Parameters

keystringRequired

Component ID. Case-sensitive, and must match the component's ID exactly.

Returns

Return Type:boolean | undefined

Whether the component is above the fold:

  • true: The host marks the component as above the fold.
  • false: The host marks the component as not above the fold.
  • undefined: The host doesn't mark the component.

Examples

Last updated: 21 October 2026

Did this help?