Skip to content
Every tutorial here is 100% free — and always will be
LSLovableStudent

How do I lazy-load images?

Last checked 31 Aug 2026

Short answer

Ask Lovable to add native lazy-loading to images below the fold while keeping the hero/first-visible image loading eagerly, so visitors aren't downloading offscreen images before they're needed.

What lazy-loading does

Lazy-loading defers downloading an image until it's about to scroll into view, instead of loading every image on the page immediately. It reduces initial page weight and speeds up load for what's actually visible.

What to lazy-load, and what not to

  • Lazy-load: images further down a long page — galleries, blog post images, footer content, secondary product photos.
  • Don't lazy-load: the first visible hero image or anything above the fold — that's usually the LCP element, and lazy-loading it works against Core Web Vitals rather than for it.

How to ask Lovable

Add lazy-loading to images that appear below the fold across the site, but make sure the main hero image on each page still loads immediately.

Lovable can implement this with the standard HTML loading="lazy" attribute or an equivalent React pattern, depending on how images are rendered in the codebase.

Confirming it worked

Open DevTools → Network tab, reload the page, and check that offscreen images only start downloading as you scroll toward them rather than all at once on load.

What usually goes wrong

  • Lazy-loading everything indiscriminately, including the hero image, which then delays the metric (LCP) it was supposed to help.
  • Assuming lazy-loading alone fixes slow images — a lazy-loaded but still uncompressed 5MB image is still slow once it loads. Combine lazy-loading with compression and correct sizing.
  • Images loaded via CSS background-image don't support native lazy-loading the same way — these need a different approach (e.g. loading them via JavaScript on scroll), so flag these separately when asking Lovable.

See /questions/how-do-i-optimise-images for the full image checklist.

Sources

Was this answer helpful?

Related questions

Website made, maintained and hosted by PromptSites.com

PromptSites logo