Skip to main content
Checks if offscreen images use lazy loading
Rule IDimages/offscreen-lazy
CategoryImages
ScopePer-page
Severitywarning
Weight5/10

Solution

Add loading=‘lazy’ to images below the fold to defer loading until needed. This reduces initial page load time and saves bandwidth. Exception: Don’t lazy-load LCP image or above-the-fold content. Use loading=‘eager’ for critical images.

Options

This rule supports the following configuration options:
OptionTypeDefaultDescription
above_fold_countunknownundefinedNumber of images considered above the fold

Configuration Example

squirrel.toml
[rules."images/offscreen-lazy"]
above_fold_count = undefined

Enable / Disable

Disable this rule

squirrel.toml
[rules]
disable = ["images/offscreen-lazy"]

Disable all Images rules

squirrel.toml
[rules]
disable = ["images/*"]

Enable only this rule

squirrel.toml
[rules]
enable = ["images/offscreen-lazy"]
disable = ["*"]