{"data":{"slug":"github-thedaviddias-front-end-checklist-skills-offscreen-lazy-de95497ba24b","title":"Lazy Load Offscreen Images","summary":"Add `loading='lazy'` to images below the fold to reduce initial load time and improve performance. Ensure critical images (LCP) are not lazy-loaded and use `fetchpriority='high'` instead.","url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-offscreen-lazy-de95497ba24b","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-thedaviddias-front-end-checklist-skills-offscreen-lazy-de95497ba24b","markdown_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-offscreen-lazy-de95497ba24b.md","download_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-offscreen-lazy-de95497ba24b\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Always pair `loading='lazy'` with `width` and `height` attributes to prevent layout shifts (CLS). If the fold position is unclear from the code snippet, do not assume the image is offscreen or non-critical.","instructions":"---\nname: offscreen-lazy\ndescription: \"Use when reviewing image assets, markup, and CDN or build transforms related to Lazy load offscreen images. Check encoded size, rendered size, loading strategy, and above-the-fold impact together. Missing `loading='lazy'` is only a valid finding when you can reasonably tell the image is offscreen or non-critical.\"\nmetadata:\n  category: images\n  priority: high\n  difficulty: beginner\n  estimatedTime: \"10\"\n  source: frontendchecklist.io\n  url: https:\/\/frontendchecklist.io\/rules\/images\/offscreen-lazy\n---\n\n# Lazy load offscreen images\n\nLazy loading eliminates unnecessary image downloads on initial page load. A page with 20 images below the fold may transfer several megabytes of data that users who don't scroll will never see. Deferring these downloads reduces Time to Interactive, improves LCP for above-fold content, and saves bandwidth\u2014particularly impactful for users on metered mobile connections.\n\n## Quick Reference\n\n- Add `loading=\"lazy\"` to all `<img>` elements below the fold\n- Never lazy-load the LCP image (hero, first product image)\u2014use `fetchpriority=\"high\"` instead\n- Always pair `loading=\"lazy\"` with `width` and `height` attributes to prevent CLS\n- Native `loading=\"lazy\"` has universal support in all modern browsers\u2014no JavaScript polyfill needed\n- If fold position is unclear from the snippet, do not invent a lazy-loading defect\n\n## Check\n\nScan all <img> elements in this codebase. Identify: 1) Any <img> elements below the fold (not in the first viewport) that are missing loading=\"lazy\". 2) Any <img> elements marked loading=\"lazy\" that appear to be above the fold (hero images, first product images, logos in headers). 3) Any <img> with loading=\"eager\" below the fold. Report the above-fold images that should NOT have lazy loading separately from below-fold images that should have it. If fold position cannot be inferred from the snippet, do not report missing lazy loading as a defect.\n\n## Fix\n\nFor images that should use lazy loading: 1) Add loading=\"lazy\" to all <img> elements that appear below the fold. 2) Remove loading=\"lazy\" from any hero, logo, or first-visible image\u2014these should load immediately. 3) Ensure all lazy-loaded images have explicit width and height attributes to prevent CLS. 4) For the LCP image specifically, add fetchpriority=\"high\" and remove loading=\"lazy\". Show the corrected HTML for each modified image.\n\n## Explain\n\nExplain how native browser lazy loading works. The loading=\"lazy\" attribute tells the browser to defer image download until the image is within a browser-defined distance from the viewport (typically 1250px on a slow connection). This reduces the data transferred on initial load, lowers Time to Interactive, and saves bandwidth for users who never scroll to those images. Browser support is universal in modern browsers. The critical caveat: never lazy-load the LCP image\u2014it must load as fast as possible.\n\n## Code Review\n\nReview image assets, markup, and delivery configuration related to Lazy load offscreen images. Flag exact files or components where format choice, sizing, or loading behavior violates the rule, and describe how to confirm the fix in DevTools.\n\n---\n\nFor full implementation details, code examples, and framework-specific guidance,\nsee `references\/rule.md`.\n\nRule page: https:\/\/frontendchecklist.io\/rules\/images\/offscreen-lazy\n","use_cases":["Review image markup for missing `loading='lazy'` on offscreen images.","Fix lazy-loading issues in codebases with large image assets.","Ensure critical images (LCP) are not lazy-loaded and use `fetchpriority='high'` instead."],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/thedaviddias\/Front-End-Checklist\/blob\/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e\/skills\/offscreen-lazy\/SKILL.md","source_commit":"e8d14d049010e2ce25afcd5e8609dfcbbe63e47e","license":null,"version":null,"listing_approved_at":"2026-11-24","created_at":"2026-11-23T05:02:41.000000Z","updated_at":"2026-11-24T07:12:05.000000Z","seo_title":"Lazy Load Offscreen Images for Performance","seo_description":"Optimize image loading by lazy-loading offscreen images. Improve performance and reduce initial load time with native browser support.","seo_keywords":["lazy load images","optimize image loading","improve page performance","fix lazy loading issues","browser lazy loading"]}}