Free auditStart free
GuideNext.js · Page speed

Next.js lazy loading

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.

4 min
read
4
sources
Oct 28, 2026
updated
Scaplet Editorial Team
author
In one line

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.

30-second check

Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode

At a glance

4 facts from the sources below
`loading="lazy"`
Image default
`next/dynamic` or `React.lazy()` with Suspense
Component API
Client Components and imported libraries
Applies to
Keep eager
Hero image
02Checklist

Lazy load a Client Component

Three behaviors are in that one file. 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.
First2
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."
Dynamically importing a Server Component only lazy loads its Client Component children. The Server Component itself is not lazy loaded. The docs add that this helps preload static assets such as CSS.
Next2
Automatic code splitting is not supported yet when a Server Component dynamically imports a Client Component. The docs list this as a current limitation.
Named exports need a .then(). Return the export from the promise: import('../components/hello').then((mod) => mod.Hello).
Then1
Add a loading option when the gap is visible. dynamic(() => import('../components/WithCustomLoading'), { loading: () => <p>Loading...</p> }) renders a placeholder while the chunk loads.
app/page.js (from the Next.js docs)
'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>
  )
}
03Check it

Load a library only when it is used

For a heavy dependency that only one interaction needs, skip components entirely and call import() inside the handler. The Next.js example loads fuse.js for fuzzy search only after the user types in the input.
Load fuse.js on first keystroke
'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>
  )
}
05How it works

Check it worked

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.

  1. 01

    Inspect the hero markup

    Open the page, right-click the largest above-the-fold image, choose Inspect, and confirm the <img> does not have loading="lazy".

  2. 02

    Watch chunks load on interaction

    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.

  3. 03

    Confirm the LCP element

    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.

  4. 04

    Disable JavaScript for ssr: false parts

    View source or turn off JavaScript to see what the server sent. Anything you wrapped with ssr: false will be missing there by design.

Questions

Asked a lot.

3 questions people ask next, answered from the sources on this page.

01Is next/image lazy loaded by default?

Yes. The Next.js reference says loading defaults to lazy. Set loading="eager" or fetchPriority="high" on an above-the-fold image.

02When should I use ssr: false in next/dynamic?

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.

03Is priority still valid in Next.js 16?

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.

Sources · 4

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • nextjs.org
  • web.dev
  1. 01How to lazy load Client Components and libraries | Next.js Documentationnextjs.org · checked 2026-11-01
  2. 02Image Component | Next.js Documentationnextjs.org · checked 2026-11-01
  3. 03Browser-level image lazy loading for the web | web.devweb.dev · checked 2026-11-01
  4. 04Optimize Largest Contentful Paint | web.devweb.dev · checked 2026-11-01
Free · 2 minutes

Tools point. Agencies advise. This one ships.

Run the free audit, then approve the fixes. Every change can be undone.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane