Images
- How
<Image loading="lazy" />fromnext/image- Default
- Defaults to lazy
Lazy load images with next/image and Client Components with next/dynamic or React.lazy, and keep the hero image eager so LCP does not suffer.
In Next.js, next/image defaults to loading="lazy", so you only act on above-the-fold images. For JavaScript, lazy load Client Components with next/dynamic or React.lazy() with Suspense, or load a library with import() when needed. Never lazy load the Largest Contentful Paint image: web.dev says not to lazy-load images likely to be in the viewport at load.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
<Image loading="lazy" /> from next/imagedynamic(() => import('../components/A')) from next/dynamicawait import('fuse.js') inside an event handlerThe Next.js lazy loading guide says lazy loading "applies to Client Components": Server Components are already code split. It also notes that next/dynamic is a composite of React.lazy() and Suspense, and that it behaves the same way in the app and pages directories, which helps if you are migrating.
ComponentA still renders on first load but ships in its own bundle. ComponentB is not fetched until the condition is true. ComponentC with ssr: false is not prerendered, so its HTML is absent from the server response. Keep that last point in mind for anything you want indexed: content that only exists after client-side loading may not be in the HTML a crawler first receives.ssr: false is for Client Components only. The docs say it is not supported in Server Components and show the error "ssr: false is not allowed with next/dynamic in Server Components. Please move it into a Client Component.".then(). Return the export from the promise: import('../components/hello').then((mod) => mod.Hello).loading option when the gap is visible. dynamic(() => import('../components/WithCustomLoading'), { loading: () => <p>Loading...</p> }) renders a placeholder while the chunk loads.'use client'
import { useState } from 'react'
import dynamic from 'next/dynamic'
// Client Components:
const ComponentA = dynamic(() => import('../components/A'))
const ComponentB = dynamic(() => import('../components/B'))
const ComponentC = dynamic(() => import('../components/C'), { ssr: false })
export default function ClientComponentExample() {
const [showMore, setShowMore] = useState(false)
return (
<div>
{/* Load immediately, but in a separate client bundle */}
<ComponentA />
{/* Load on demand, only when/if the condition is met */}
{showMore && <ComponentB />}
<button onClick={() => setShowMore(!showMore)}>Toggle</button>
{/* Load only on the client side */}
<ComponentC />
</div>
)
}import() inside the handler. The Next.js example loads fuse.js for fuzzy search only after the user types in the input.'use client'
import { useState } from 'react'
const names = ['Tim', 'Joe', 'Bel', 'Lee']
export default function Page() {
const [results, setResults] = useState()
return (
<div>
<input
type="text"
placeholder="Search"
onChange={async (e) => {
const { value } = e.currentTarget
// Dynamically load fuse.js
const Fuse = (await import('fuse.js')).default
const fuse = new Fuse(names)
setResults(fuse.search(value))
}}
/>
<pre>Results: {JSON.stringify(results, null, 2)}</pre>
</div>
)
}next/image reference lists loading as defaulting to lazy, where lazy means "Defer loading the image until it reaches a calculated distance from the viewport" and eager means "Load the image immediately, regardless of its position in the page." That default is right for most images. The risk is the one image that matters for speed.loading="eager"fetchPriority="high"preload; web.dev says it raises fetch priority for an important image such as the LCP imagepreloadpreload={true}<link> in the <head>; docs say to use it for the LCP element, but in most cases use loading="eager" or fetchPriority="high" insteadprioritypreloadimport Image from 'next/image'
export function Hero() {
return (
<Image
src="/hero.jpg"
alt="Product dashboard overview"
width={1200}
height={630}
loading="eager"
/>
)
}Do not combine them. The docs say not to use preload together with loading or fetchPriority, and web.dev notes that loading="lazy" with fetchpriority="high" is still delayed while off-screen. For light and dark variants of one image, the docs explain that preload or loading="eager" would make both images load, so use fetchPriority="high" there.
For image alt text and responsive delivery, see Next.js image SEO. For the rest of a speed pass, see the Next.js SEO guides.
Open the page, right-click the largest above-the-fold image, choose Inspect, and confirm the <img> does not have loading="lazy".
Open DevTools, go to the Network tab, filter by JS, then click the control that opens your lazy component. A new chunk request should appear at that moment, not on first load.
In Chrome DevTools, the Performance panel's live metrics view shows your local LCP next to the CrUX value, and a performance trace's Insights break LCP into subparts. web.dev defines resource load delay as the time between TTFB and when the browser starts loading the LCP resource, so a large value for an image means loading started late.
View source or turn off JavaScript to see what the server sent. Anything you wrapped with ssr: false will be missing there by design.
3 questions people ask next, answered from the sources on this page.
Yes. The Next.js reference says loading defaults to lazy. Set loading="eager" or fetchPriority="high" on an above-the-fold image.
Only inside a Client Component, and only when a component cannot or should not be prerendered. The option is not supported in Server Components, and the component's HTML will not be in the server response.
It is deprecated in favor of preload, according to the next/image reference. The same page says to use loading="eager" or fetchPriority="high" in most cases rather than preload.
Run the free audit, then approve the fixes. Every change can be undone.