When building a web application, we often focus on adding new features and making the UI look great. But no matter how beautiful your application is, users won't enjoy using it if it loads slowly or feels unresponsive.
Performance is no longer just a nice-to-have feature—it's an essential part of the user experience.
This is where Web Vitals come in.
Web Vitals are a set of metrics introduced by Google to help developers measure the real-world performance of their websites. Instead of guessing whether an application is fast, Web Vitals provide measurable data that reflects how users actually experience your site.
In this article, we'll learn:
- What Web Vitals are
- Why they matter
- The Core Web Vitals metrics
- How to measure them
- Practical ways to improve them
Let's get started.
What Are Web Vitals?
Web Vitals are performance metrics that measure how users experience your website.
They focus on three important aspects:
- Loading speed
- Interactivity
- Visual stability
Unlike traditional performance metrics that only measure page load time, Web Vitals focus on how users actually perceive the performance of a webpage.
For example:
- How quickly does the main content appear?
- How fast does the page respond to user interactions?
- Does the layout unexpectedly shift while loading?
These are the questions Web Vitals help answer.
Why Are Web Vitals Important?
Imagine visiting an e-commerce website.
- The page takes 8 seconds to load.
- The "Buy Now" button appears late.
- Just as you're about to click it, the layout shifts and you accidentally click something else.
That's a frustrating experience.
Poor performance can lead to:
- Higher bounce rates
- Lower user engagement
- Reduced conversions
- Poor SEO rankings
Google also uses Core Web Vitals as one of the signals for page experience, making them important for search visibility.
The Core Web Vitals
There are three Core Web Vitals that every developer should know.
1. Largest Contentful Paint (LCP)
LCP measures how quickly the largest visible content is rendered.
Usually, this is:
- Hero image
- Banner
- Large heading
- Main content section
Good Score
| Rating | Time |
| Good | Less than 2.5 seconds |
| Needs Improvement | 2.5–4 seconds |
| Poor | More than 4 seconds |
Common reasons for poor LCP
- Large images
- Slow server response
- Render-blocking CSS
- Heavy JavaScript bundles
How to improve LCP
- Optimize images
- Use modern formats like WebP or AVIF
- Enable caching
- Use lazy loading where appropriate (avoid lazy-loading above-the-fold content)
- Minimize render-blocking resources
- Split large JavaScript bundles
2. Interaction to Next Paint (INP)
INP measures how quickly your application responds to user interactions.
Examples:
- Clicking a button
- Opening a modal
- Typing in a search box
- Expanding an accordion
A page may load quickly but still feel slow if interactions take a long time.
Good Score
| Rating | Time |
| Good | Less than 200 ms |
| Needs Improvement | 200–500 ms |
| Poor | More than 500 ms |
Common reasons for poor INP
- Heavy JavaScript execution
- Long-running tasks on the main thread
- Large React component re-renders
- Expensive event handlers
How to improve INP
- Reduce unnecessary re-renders
- Use React.memo where appropriate
- Memoize expensive calculations with useMemo
- Use useCallback for stable event handlers when beneficial
- Virtualize long lists
- Break large tasks into smaller chunks
- Offload heavy work to Web Workers if possible
3. Cumulative Layout Shift (CLS)
CLS measures how much the page layout unexpectedly shifts while loading.
Have you ever tried clicking a button, only for an advertisement to load above it and move everything down?
That's a layout shift.
Good Score
| Rating | Score |
| Good | Less than 0.1 |
| Needs Improvement | 0.1–0.25 |
| Poor | More than 0.25 |
Common reasons
- Images without width and height
- Ads loading dynamically
- Fonts swapping during load
- Dynamically inserted content
How to improve CLS
- Always define image dimensions
- Reserve space for ads and banners
- Avoid inserting content above existing content
- Use
font-displaythoughtfully and preload important fonts
Other Useful Performance Metrics
Although not part of Core Web Vitals, these metrics are still useful.
First Contentful Paint (FCP)
Measures how long it takes for the first piece of content to appear.
Examples:
- Logo
- Heading
- Navigation
A faster FCP reassures users that the page is loading.
Time to First Byte (TTFB)
Measures how quickly the browser receives the first byte from the server.
A slow TTFB usually indicates:
- Slow backend
- Poor hosting
- Database delays
- Missing caching
Total Blocking Time (TBT)
Measures how long the main thread is blocked before the page becomes interactive.
It's particularly useful during development because it often correlates with responsiveness issues.
How to Measure Web Vitals
There are several tools available.
1. Lighthouse
The easiest way to analyse your application.
Open Chrome DevTools.
Inspect
→ Lighthouse
→ Generate Report
Lighthouse provides:
- Performance score
- Accessibility
- SEO
- Best practices
- Core Web Vitals suggestions
2. Chrome DevTools Performance Panel
The Performance panel lets you record page activity and inspect:
- JavaScript execution
- Rendering
- Layout shifts
- Network activity
- Long tasks
It's especially useful when investigating performance bottlenecks.
3. PageSpeed Insights
Google's PageSpeed Insights combines lab data from Lighthouse with real user data (when available), giving you a broader view of performance.
It also provides actionable recommendations to improve Core Web Vitals.
4. web-vitals Library
You can measure Core Web Vitals directly in your application.
Install the package:
npm install web-vitals
Example:
import { onCLS, onINP, onLCP } from "web-vitals";
onCLS(console.log);
onINP(console.log);
onLCP(console.log);
You can send these metrics to analytics services to monitor real user performance in production.
React Performance Tips That Improve Web Vitals
If you're building React applications, these techniques can have a noticeable impact:
- Split large bundles using dynamic imports.
- Lazy-load routes and heavy components.
- Optimise images and serve modern formats.
- Virtualize large lists instead of rendering thousands of items.
- Avoid unnecessary re-renders by managing state carefully.
- Memoize expensive calculations only when profiling shows a benefit.
- Optimise API calls and cache data where appropriate.
- Use skeleton loaders instead of blocking the UI with spinners.
A Real-World Example
Imagine a dashboard that displays 100,000 records.
A straightforward implementation might render every row at once, leading to:
- Slow page loads
- Unresponsive scrolling
- Poor INP
- Higher LCP
A better approach is to use list virtualization (for example, with react-window or @tanstack/react-virtual). Only the visible rows are rendered, dramatically reducing the amount of work the browser performs.
This results in:
- Faster rendering
- Smoother scrolling
- Better responsiveness
- Improved Web Vitals
Common Mistakes
Avoid these common performance pitfalls:
- Rendering large lists without virtualization.
- Shipping oversized JavaScript bundles.
- Using unoptimised images.
- Triggering unnecessary component re-renders.
- Running expensive work synchronously on the main thread.
- Loading every resource on the initial page load.
Best Practices Checklist
- ✅ Compress and optimise images.
- ✅ Split code into smaller chunks.
- ✅ Enable browser caching.
- ✅ Remove unused JavaScript and CSS.
- ✅ Virtualize large lists.
- ✅ Use lazy loading for below-the-fold content.
- ✅ Minimise layout shifts.
- ✅ Measure performance regularly using Lighthouse and real-user monitoring.
- ✅ Optimise server response times.
Final Thoughts
Performance isn't just about getting a high Lighthouse score—it's about delivering a smooth, responsive experience for your users.
Core Web Vitals give developers a clear way to measure real-world performance and identify areas for improvement. By monitoring metrics like LCP, INP, and CLS, you can make informed decisions that improve usability, user satisfaction, and even search visibility.
Whether you're building a React application, a Next.js project, or any modern web app, keeping an eye on Web Vitals should be a regular part of your development process.
A fast application doesn't just feel better—it helps users achieve their goals more quickly and makes them more likely to return.