How to fix LCP, INP and CLS in a Next.js app
What each Core Web Vital measures, the usual causes in Next.js and React apps, and concrete fixes for each, from images to hydration to layout shifts.
Samed Škulj
· 3 min read
Core Web Vitals affect how fast your app feels and play a part in how Google ranks your pages. Each of the three metrics fails for different reasons, so the first step is always knowing which one you're fixing.
| Metric | Measures | Good |
|---|---|---|
| LCP, Largest Contentful Paint | When the main content appears | 2.5 s or less |
| INP, Interaction to Next Paint | How quickly the page responds to clicks and typing | 200 ms or less |
| CLS, Cumulative Layout Shift | How much content jumps around while loading | 0.1 or less |
Google measures these at the 75th percentile of real visits, so the numbers that count come from field data, not a single Lighthouse run on a fast laptop.
Fixing LCP
LCP is usually a hero image, a heading, or a large block of text. Find out which element it is (Chrome DevTools' Performance panel shows it), then work through the chain that delivers it.
Slow server response
If the HTML arrives late, everything is late.
- Make marketing and content pages static or revalidated instead of rendered per request.
- Remove slow data calls from the critical path, or cache them.
- Fix the database queries behind the page. N+1 queries and missing indexes are the usual suspects.
The LCP image loads late
- Use
next/imageand setpriorityon the hero image, so it's preloaded and not lazy-loaded. - Set
sizescorrectly so mobile devices get a small file. - Don't set the hero as a CSS background image; the browser discovers it late.
Content waits for JavaScript
If the main content renders only after client-side data fetching, LCP waits for the bundle to download, parse, run and fetch. Fetch that data in a Server Component so it's in the initial HTML.
Fonts block text
Use next/font, which self-hosts fonts and avoids render-blocking requests to font providers.
Fixing INP
INP measures the delay between a user's interaction and the next visual update. Poor INP means the main thread is busy when the user clicks.
Too much JavaScript on load
Hydration of a large page can keep the main thread busy for seconds on mid-range phones. Reduce what hydrates:
- Push
"use client"down to small interactive components. - Load heavy, below-the-fold or after-click components with
next/dynamic. - Remove or delay third-party scripts with
next/script.
Expensive event handlers
- Filtering or sorting a large list on every keystroke: debounce input, or use
useDeferredValue/useTransitionso typing stays responsive. - Re-rendering a whole page on a small state change: move state down, memoise expensive children, split large contexts.
- Rendering thousands of rows: virtualise long lists.
Long tasks you didn't write
Analytics, chat widgets and A/B testing scripts often run long tasks. Measure with and without them in the Performance panel.
Fixing CLS
Layout shifts happen when something appears or resizes after nearby content has already rendered.
- Images and video without dimensions.
next/imagerequires them; for other media, setwidthandheightor anaspect-ratio. - Content injected above existing content: cookie banners, promo bars, late-loading ads. Reserve the space, or overlay instead of pushing content down.
- Web fonts swapping with a different size than the fallback.
next/fontadjusts fallback metrics to reduce this. - Skeletons that don't match the final content size. Make loading states the same height as what they replace.
Verify with field data
After each fix, check the lab numbers for a quick signal, then watch field data over the following weeks; it takes time to update. Fix the worst pages by traffic first, since that's where most users are.
For the broader process, see the Next.js performance checklist. If you want the analysis done for you, the performance and code audit delivers a ranked fix list with effort estimates in five days.

Written by Samed Škulj
Senior Full-Stack Engineer since 2021. I have shipped with teams at Deel, HTEC Group (for Zoox), Ministry of Programming, and now help SaaS teams add AI features and get AI-built apps ready for production. LinkedIn