---
title: "Core Web Vitals for Vue Applications"
description: "Measure LCP, INP, and CLS for a Vue app, investigate loading and interaction work, and distinguish field results from lab diagnostics."
canonical_url: "https://nuxtseo.com/learn-seo/vue/launch-and-listen/core-web-vitals"
last_updated: "2026-10-05"
---

> Index of every page on this site: [llms.txt](https://nuxtseo.com/llms.txt)

::key-takeaways
- Assess each metric separately at p75, segmented mobile and desktop: good LCP ≤ 2.5s, INP ≤ 200ms, and CLS ≤ 0.1
- Google uses Core Web Vitals alongside other ranking signals; good metrics do not guarantee a ranking
- INP replaced First Input Delay on March 12, 2024. Interactive lab recordings can diagnose latency; a navigation-only Lighthouse run does not establish field INP
- Initial HTML can expose content earlier. Measure server response, assets, and rendering work before choosing an architecture
::

[Core Web Vitals](https://developers.google.com/search/docs/appearance/core-web-vitals) became a Google ranking factor with the Page Experience update in June 2021. The metrics measure loading performance, interactivity, and visual stability. These affect how usable a page feels.

## The Three Metrics

### LCP (Largest Contentful Paint)

[LCP](https://web.dev/articles/lcp) measures when the largest qualifying contentful image, text block, or video appears in the viewport. It does not measure every visible element.

**Thresholds:**

- Good: ≤ 2.5 seconds
- Needs improvement: > 2.5 and ≤ 4.0 seconds
- Poor: > 4.0 seconds

### INP (Interaction to Next Paint)

INP [replaced First Input Delay (FID) on March 12, 2024](https://web.dev/blog/inp-cwv-march-12) as the standard responsiveness metric. INP summarizes click, tap, and keyboard interaction latency across a page visit. It does not guarantee every interaction is fast.

**Thresholds:**

- Good: ≤ 200 milliseconds
- Needs improvement: > 200 and ≤ 500 milliseconds
- Poor: > 500 milliseconds

Interactions after the initial load can contribute. Inspect the actual slow interaction rather than relying on a navigation-only lab score.

### CLS (Cumulative Layout Shift)

[CLS](https://web.dev/articles/cls) measures the largest burst of eligible shifts in a session window. Shifts shortly after qualifying user input are excluded. Images, changing font metrics, and dynamic content can contribute.

**Thresholds:**

- Good: ≤ 0.1
- Needs improvement: > 0.1 and ≤ 0.25
- Poor: > 0.25

## Vue LCP Optimizations

### Avoid Client-Side Rendering for Content

[Vue’s performance guide](https://vuejs.org/guide/best-practices/performance.html) recommends initial HTML for load-sensitive content. SSR or SSG can expose content before app JavaScript runs. Server latency, asset discovery, and client work still affect the result; no rendering mode guarantees good LCP.

### Preload Critical Assets

Supply the actual image and font files in your public assets. Match the preload URL to the resource the page uses. These markup excerpts demonstrate hints, not a measured performance result:

```html
<head>
  <link rel="preload" href="/hero.jpg" as="image">
  <link rel="preload" href="/fonts/inter-var.woff2" as="font" type="font/woff2" crossorigin>
</head>
```

### Lazy Load Below-Fold Images

Avoid lazy loading the LCP image. Lazy loading can defer below-fold images; replace these image paths and alt text with your actual content:

```vue
<template>
  <div>
    <!-- Above-fold: eager loading -->
    <img src="/hero.jpg" alt="Hero" width="1200" height="600">

    <!-- Below-fold: lazy loading -->
    <img
      src="/product-1.jpg"
      alt="Product"
      width="800"
      height="600"
      loading="lazy"
    >
  </div>
</template>
```

Dimensions or a reliable aspect ratio reserve image space. Other content can still shift.

### Optimize Font Loading

Use `font-display: swap` when fallback text should remain visible during loading. The fallback’s metrics still matter for layout shifts:

```css
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-var.woff2') format('woff2');
  font-display: swap;
}
```

### Dynamic Imports for Route Components

This router setup requires installed Vue Router, a client entry that installs the router, and the referenced Home.vue and Dashboard.vue files. [Lazy route imports](https://router.vuejs.org/guide/advanced/lazy-loading) defer those component chunks:

```ts
import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      component: () => import('./views/Home.vue')
    },
    {
      path: '/dashboard',
      component: () => import('./views/Dashboard.vue')
    }
  ]
})
```

Fetching data, component code, and images in parallel rather than in sequence also keeps LCP from stacking delays. Vue’s [`<Suspense>`{lang="html"}](https://vuejs.org/guide/built-ins/suspense.html) coordinates async dependencies. It does not itself ensure independent requests start in parallel.

## Vue INP Optimizations

### Yield to the Main Thread

Break up long client-side work at measured yield points. [Feature-detect scheduler.yield](https://developer.chrome.com/blog/use-scheduler-yield) and use its documented timer fallback where unavailable. Keep browser APIs in client interaction code. Yielding allows other work to run; it does not make heavy computation cheaper.

### Debounce Event Handlers

Debounce rapid input only when the task permits a short delay. Follow [VueUse useDebounceFn](https://vueuse.org/shared/useDebounceFn/) with an installed @vueuse/core dependency and measure the actual interaction. Debouncing alone does not guarantee good INP.

### Use v-memo for Large Lists

[v-memo](https://vuejs.org/api/built-in-directives.html#v-memo) can skip subtree updates while its dependencies remain equal. Include every value whose change should update that subtree. An incomplete dependency array can leave visible content stale; profile before adding memoization.

### Offload Heavy Computation to Web Workers

For suitable CPU work, follow the [Web Workers guide](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers). The app must supply its worker computation, message contract, and lifecycle cleanup. Workers do not manipulate the DOM directly; message and scheduling costs still matter.

### Optimize Computed Properties

[Computed properties](https://vuejs.org/guide/essentials/computed.html) cache results until reactive dependencies change. Use them for derived values and measure the cost of the actual calculation. Reducing total work and yielding at useful points can improve responsiveness; neither guarantees field INP.

## Vue CLS Fixes

### Set Image Dimensions

Reserve space to avoid shifts caused by image loading:

```vue
<template>
  <img
    src="/product.jpg"
    alt="Product"
    width="800"
    height="600"
  >
</template>
```

Or use aspect ratio with CSS:

```vue
<template>
  <div class="image-container">
    <img src="/product.jpg" alt="Product">
  </div>
</template>

<style scoped>
.image-container {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
</style>
```

### Reserve Space for Dynamic Content

This template requires app-owned loading and data state. Reserve dimensions matching the actual content; a placeholder of arbitrary height does not guarantee stable layout:

```vue
<template>
  <div class="content">
    <div v-if="loading" class="skeleton">
      <!-- Same dimensions as actual content -->
    </div>
    <div v-else>
      {{ data }}
    </div>
  </div>
</template>

<style scoped>
.skeleton {
  height: 200px; /* Match real content height */
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
}
</style>
```

### Avoid Flash of Unstyled Content (FOUC)

Preload fonts and use `font-display: swap`:

```html
<head>
  <link rel="preload" href="/fonts/inter-var.woff2" as="font" type="font/woff2" crossorigin>
</head>
```

```css
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-var.woff2') format('woff2');
  font-display: swap;
}
```

[Metric-matched fallback fonts](https://developer.chrome.com/blog/framework-tools-font-fallback) can reduce font-swap shifts. Measure the chosen fonts; a fixed size-adjust value does not establish a match.

### Handle Ads and Embeds

Reserve space for third-party content:

```vue
<template>
  <div class="ad-container" style="min-height: 250px;">
    <!-- Ad loads here -->
  </div>
</template>
```

## Measuring Core Web Vitals

[PageSpeed Insights](https://pagespeed.web.dev/) shows CrUX field data when sufficient qualifying visits exist, plus lab diagnostics. Check URL versus origin scope and assess mobile and desktop separately. Own RUM providers can use different collection windows than CrUX’s rolling 28 days.

### Real User Monitoring (RUM) Tools

Choose a provider whose current collection scope and plans fit your app. [Datadog RUM](https://www.datadoghq.com/product/real-user-monitoring/) and [Vercel Speed Insights](https://vercel.com/docs/speed-insights) have their own setup, data, and plan limits. Verify collection before treating a dashboard as coverage of your traffic.

### Chrome DevTools Performance Panel

Run Lighthouse from Chrome DevTools for local testing; it measures LCP, CLS, and provides optimization suggestions. For a live session, record frame-by-frame rendering in the Performance tab:

1. Open DevTools → Performance
2. Click Record
3. Interact with your page
4. Stop recording
5. View LCP, CLS, and long tasks

[Chrome DevTools](https://developer.chrome.com/docs/devtools/performance/reference#core-web-vitals) shows local LCP and CLS scores instantly. Interact with the page to capture INP.

### web-vitals Library

Install the [web-vitals library](https://github.com/GoogleChrome/web-vitals). Run these callbacks once from your browser entry, not during SSR:

```bash
pnpm add web-vitals
```

```ts
import { onCLS, onINP, onLCP } from 'web-vitals'

onLCP(metric => console.log('LCP:', metric.value))
onINP(metric => console.log('INP:', metric.value))
onCLS(metric => console.log('CLS:', metric.value))
```

Callbacks report visit metrics, not an aggregated p75. Configure a real collection and aggregation pipeline separately. Do not round CLS to an integer. Compare each metric’s p75 by device; CrUX supplies the field dataset used by PageSpeed Insights and Search Console.

## Core Web Vitals Impact on Rankings

Google [uses Core Web Vitals alongside other ranking signals](https://developers.google.com/search/docs/appearance/core-web-vitals). Good metrics do not guarantee a ranking.

Assess each metric’s p75 separately for mobile and desktop. The [2025 Web Almanac](https://almanac.httparchive.org/en/2025/performance) found that 48% of measured mobile origins and 56% of measured desktop origins passed all three in July 2025. LCP failed most often in that sample.

## Checklist

::checklist{#vue-core-web-vitals}
- Check each metric’s p75 separately for mobile and desktop, confirming available field data and URL/origin scope
- For load-sensitive content, assess initial HTML delivery alongside server latency and client work
- Feature-detect `scheduler.yield()`{lang="ts"} before using it, with the documented timer fallback where unavailable
- Set `width` and `height` (or `aspect-ratio`) on every image, and reserve space for dynamic content and ads
- Use calibrated CPU throttling for interaction diagnosis; confirm field results separately
::

Using Nuxt? It ships [built-in performance optimizations](https://nuxt.com/docs/4.x/guide/best-practices/performance) including code splitting and hybrid rendering. Image optimization requires an appropriate image integration: see the [Nuxt Core Web Vitals guide](https://nuxtseo.com/learn-seo/nuxt/launch-and-listen/core-web-vitals) for framework-specific implementations.

## Sitemap

See the full [sitemap](https://nuxtseo.com/sitemap.md) for all pages.
