Skip to main content
Back to Blog
Core Web VitalsNext.jsSEO

Core Web Vitals in Next.js: Optimizing LCP, CLS, and INP in 2026

8 min read

How to measure and improve Core Web Vitals in your Next.js apps — optimizing LCP with image priority, eliminating CLS from dynamic content, and reducing INP for a perfect Google score.

Core Web Vitals are Google's standardised metrics for measuring real-user web performance, directly influencing both search rankings and user experience quality. As a Next.js developer who optimises production platforms for thousands of users, Muhammad Sufyan of Sufyan Frontend shares this complete guide to measuring and improving LCP, CLS, and INP in your Next.js applications in 2026.

Understanding the Three Core Web Vitals

Largest Contentful Paint (LCP) measures how quickly the largest visible element — typically a hero image or headline — loads and becomes visible to the user. A good LCP score is under 2.5 seconds. Cumulative Layout Shift (CLS) measures visual stability — how much elements move around during page load. A good CLS score is under 0.1. Interaction to Next Paint (INP), which replaced First Input Delay in 2024, measures responsiveness to user interactions throughout the entire page visit. A good INP score is under 200 milliseconds.

Optimising LCP in Next.js

The most effective LCP optimisation in Next.js is using the priority prop on your above-the-fold hero image. This triggers a preload link in the HTML head, causing the browser to download the image as early as possible. Combine this with serving images in modern formats like WebP or AVIF through the next/image component for the best possible LCP scores.

// Preload your LCP image
<Image
  src="/hero.jpg"
  alt="Hero"
  width={1200}
  height={600}
  priority  // This generates a preload link
  sizes="100vw"
/>

Eliminating CLS in Next.js Applications

  • Always specify width and height on Image components to reserve space
  • Avoid inserting content above existing content after page load
  • Use CSS min-height to reserve space for dynamically loaded content
  • Load web fonts with font-display: swap and preload your primary font

Reducing INP in React Applications

INP is primarily a JavaScript execution problem. Long tasks that block the main thread for more than 50ms cause poor INP scores. Break up long tasks with setTimeout or the Scheduler API, defer non-critical JavaScript loading, and use the React Compiler to minimise unnecessary re-renders that contribute to main thread congestion during interactions.

Conclusion

Excellent Core Web Vitals scores require deliberate engineering decisions throughout your Next.js application — not a last-minute optimisation sprint. Muhammad Sufyan applies these techniques on production platforms including ehya.com.pk to maintain strong Google performance scores. For more performance engineering insights from Sufyan Frontend Developer, visit https://sufyan-frontend.vercel.app.