Core Web Vitals
Measure the affected route before changing it. Do not apply generic performance
advice without identifying the actual LCP element, slow interaction, or layout
shift.
Targets and evidence
Use Google's current thresholds at the 75th percentile:
| Metric |
Good |
Poor |
| LCP |
≤ 2.5 s |
> 4 s |
| INP |
≤ 200 ms |
> 500 ms |
| CLS |
≤ 0.1 |
> 0.25 |
Field data and lab data answer different questions. Check CrUX or PageSpeed
Insights for user impact, then reproduce locally with Chrome DevTools or a
repeatable browser trace. Lighthouse reports LCP and CLS, but cannot measure INP
without real interaction; use its Total Blocking Time only as a lab proxy.
Official references:
Diagnose
- Identify the affected app and route. Read its page, layout, loading boundary,
client components, data queries, images, fonts, and third-party scripts.
- Record a baseline on a production build with the same viewport, throttling,
cache state, and interaction sequence used for the final comparison.
- Use the trace to identify the cause:
- LCP: server delay, resource discovery, resource load, or render delay.
- INP: input delay, event-handler work, or presentation delay.
- CLS: the shifting element and the element that changed its geometry.
- Change the smallest cause supported by the trace.
Repository-specific fixes
These apps use Next.js 16 App Router. Prefer Server Components and existing
TanStack Query patterns over client-side useEffect fetching.
For LCP:
- Keep above-the-fold content in the initial server-rendered response when
possible. Use a nearby loading boundary only when streaming improves the
observed route.
- Use
next/image with correct width and height, or fill with a sized
parent and an accurate sizes value.
- Next.js 16 deprecates the Image
priority prop; use preload only for the
measured LCP image. Do not preload multiple competing images.
- Remove request waterfalls and late client-only discovery shown in the trace.
For INP:
- Trace the exact slow click, keypress, or tap. Reduce synchronous work in that
path and avoid rerendering unrelated subtrees.
- Provide immediate visual feedback, then defer only work that is not required
for the next paint.
- Virtualize or paginate large rendered collections when the trace shows DOM or
reconciliation cost. Do not add memoization without a measured benefit.
For CLS:
- Reserve dimensions for images, video, embeds, skeletons, banners, and async
content before they load.
- Keep loading and loaded states geometrically compatible.
- Animate
transform and opacity when possible instead of layout dimensions.
- Inspect font fallback metrics before changing
font-display; a blanket value
is not a CLS fix.
Verify
Build the affected app through Turbo, run the same trace again, and compare the
before/after measurements. Test relevant responsive breakpoints and both themes
when layout or assets differ.
Run pnpm format and the full pnpm build before handoff. Report the measured
baseline, the measured result, the route and conditions, and any field-data gap
that cannot be validated locally.
1---2name: core-web-vitals3description: Diagnose and improve Largest Contentful Paint, Interaction to Next Paint, and Cumulative Layout Shift in this repository's Next.js App Router frontends. Use when auditing Core Web Vitals, investigating LCP, INP, or CLS regressions, or changing frontend loading, responsiveness, image, font, or layout behavior for performance.4---56# Core Web Vitals78Measure the affected route before changing it. Do not apply generic performance9advice without identifying the actual LCP element, slow interaction, or layout10shift.1112## Targets and evidence1314Use Google's current thresholds at the 75th percentile:1516| Metric | Good | Poor |17| ------ | -------- | -------- |18| LCP | ≤ 2.5 s | > 4 s |19| INP | ≤ 200 ms | > 500 ms |20| CLS | ≤ 0.1 | > 0.25 |2122Field data and lab data answer different questions. Check CrUX or PageSpeed23Insights for user impact, then reproduce locally with Chrome DevTools or a24repeatable browser trace. Lighthouse reports LCP and CLS, but cannot measure INP25without real interaction; use its Total Blocking Time only as a lab proxy.2627Official references:2829- [Web Vitals](https://web.dev/articles/vitals)30- [Optimize LCP](https://web.dev/articles/optimize-lcp)31- [Optimize INP](https://web.dev/articles/optimize-inp)32- [Optimize CLS](https://web.dev/articles/optimize-cls)3334## Diagnose35361. Identify the affected app and route. Read its page, layout, loading boundary,37 client components, data queries, images, fonts, and third-party scripts.382. Record a baseline on a production build with the same viewport, throttling,39 cache state, and interaction sequence used for the final comparison.403. Use the trace to identify the cause:41 - LCP: server delay, resource discovery, resource load, or render delay.42 - INP: input delay, event-handler work, or presentation delay.43 - CLS: the shifting element and the element that changed its geometry.444. Change the smallest cause supported by the trace.4546## Repository-specific fixes4748These apps use Next.js 16 App Router. Prefer Server Components and existing49TanStack Query patterns over client-side `useEffect` fetching.5051For LCP:5253- Keep above-the-fold content in the initial server-rendered response when54 possible. Use a nearby loading boundary only when streaming improves the55 observed route.56- Use `next/image` with correct `width` and `height`, or `fill` with a sized57 parent and an accurate `sizes` value.58- Next.js 16 deprecates the Image `priority` prop; use `preload` only for the59 measured LCP image. Do not preload multiple competing images.60- Remove request waterfalls and late client-only discovery shown in the trace.6162For INP:6364- Trace the exact slow click, keypress, or tap. Reduce synchronous work in that65 path and avoid rerendering unrelated subtrees.66- Provide immediate visual feedback, then defer only work that is not required67 for the next paint.68- Virtualize or paginate large rendered collections when the trace shows DOM or69 reconciliation cost. Do not add memoization without a measured benefit.7071For CLS:7273- Reserve dimensions for images, video, embeds, skeletons, banners, and async74 content before they load.75- Keep loading and loaded states geometrically compatible.76- Animate `transform` and `opacity` when possible instead of layout dimensions.77- Inspect font fallback metrics before changing `font-display`; a blanket value78 is not a CLS fix.7980## Verify8182Build the affected app through Turbo, run the same trace again, and compare the83before/after measurements. Test relevant responsive breakpoints and both themes84when layout or assets differ.8586Run `pnpm format` and the full `pnpm build` before handoff. Report the measured87baseline, the measured result, the route and conditions, and any field-data gap88that cannot be validated locally.