TL;DR
CLS measures how much content jumps while the page loads and during the visit. On a Next.js service site the usual culprits are images without dimensions, late fonts, cookie banners, lazy embeds, and dynamic above-the-fold blocks. 2026 target: CLS ≤ 0.1 (good) in mobile CrUX. Below: diagnosis, space reservation, next/image + fonts, a pre-launch checklist, and App Router pitfalls.
Who is this for
- Next.js teams with red CLS in PageSpeed / CrUX
- Companies after a redesign where “it looks good but everything jumps”
- SEO owners treating Core Web Vitals as a quality signal
- Developers shipping cookie banners, chat, and third-party scripts
- Agencies delivering service sites with hero and case study media
Keyword (SEO)
cls nextjs, cumulative layout shift 2026, core web vitals cls, next/image dimensions, font swap cls, layout shift cookie banner
What CLS actually measures
CLS sums unexpected layout shifts over the observation window (including the user session, not only first paint). An element that appears inside a reserved box, or as a direct result of user input, is treated differently from a jump with no cause.
| Result | Threshold (CrUX) | Business meaning |
|---|---|---|
| Good | ≤ 0.1 | Stable UX, fewer CTA misclicks |
| Needs improvement | 0.1-0.25 | Often hero + cookie + fonts |
| Poor | > 0.25 | Users chase moving buttons |
Google ranking care about field data (CrUX). Lab (Lighthouse) is for debugging, not a substitute for RUM.
Common CLS sources on a service site
- Hero image / background without width/height or aspect-ratio
- Web fonts with late swap (FOUT shifting headlines)
- Cookie / consent banner injected above content after hydrate
- Chat widgets, reviews, maps, YouTube without placeholders
- Ads / partner logos loading late
- Dynamic CMS blocks (A/B, personalization) above the fold
- Icons / sprites appearing after JS
- Late CSS (incomplete critical CSS, FOUC)
Case studies and galleries from Branchly must leave the CMS with known media dimensions, or every new cover image can regress CLS.
Next.js Image, reserve the box
next/image helps when you set dimensions or use fill inside a ratio-locked container:
import Image from 'next/image';
export function Hero() {
return (
<div className="relative aspect-[16/9] w-full">
<Image
src="/hero-office.jpg"
alt="DevStudio office"
fill
priority
sizes="100vw"
className="object-cover"
/>
</div>
);
}Rules:
- Above the fold:
priority(LCP), but always a reserved box - Remote images:
remotePatterns+ known aspect from CMS - Avoid
height: autoon<img>without a CSS ratio - Skeleton / blur placeholder is fine if the final size matches
Fonts without typography jumps
next/font self-hosts and improves control:
import { Inter } from 'next/font/google';
const inter = Inter({
subsets: ['latin', 'latin-ext'],
display: 'swap',
adjustFontFallback: true,
});| Practice | CLS impact |
|---|---|
next/font + adjustFontFallback |
Smaller metric jump |
size-adjust / fallback metric matching |
More stable H1 |
Avoid late @import from Google CSS |
Less late layout |
Fixed line-height on hero |
Less reflow on swap |
Do not load three display families “just in case” in the first viewport.
Cookie banners and third parties
A consent bar above content after 1-2 s is classic bad CLS. Prefer:
- A reserved slot (sticky bottom with min-height), or
- Overlay / modal that does not push content
- Idle loading, but still reserved space if the banner is in-flow
| Pattern | CLS risk | Note |
|---|---|---|
| Top banner, in-flow, late | High | Worst UX + metric |
| Bottom sticky with min-height | Low/medium | Slot reserved |
| Modal / overlay | Low | Does not shift layout |
| Chat bottom-right absolute | Low | Does not push content |
Fast TTFB hosting (DevStudioIT Cloud) will not fix CLS alone: a script can still inject DOM without a box.
Diagnosis, lab vs field
- CrUX / GSC Core Web Vitals: ranking truth
- PageSpeed Insights: lab + field when available
- Chrome Performance / Experience: Layout Shift regions
- Web Vitals extension +
web-vitalsin RUM - Lighthouse CI in PRs (catch regressions before merge)
// simplified RUM hint
import { onCLS } from 'web-vitals';
onCLS((metric) => {
// send to analytics / logs
console.log(metric.name, metric.value, metric.entries);
});Inspect the largest sources in each entry: which node moved and by how much.
Pre-launch checklist
- Every above-the-fold image has ratio / dimensions
- Fonts via
next/font, fallback tuned - Cookie and chat do not push the hero
- Embeds ship with fixed-height placeholders
- No late CSS unlocking layout after first paint
- Dynamic sections below the fold or skeleton-matched height
- Test mid-tier mobile + throttling
- Compare CrUX 28 days after deploy (not only local Lighthouse)
- CMS media (Branchly) includes width/height metadata
- Deploy on stable edge (DevStudioIT Cloud), measure field, not only lab
Common mistakes
- “Lighthouse 100 here, CrUX red”: lab ≠ users on slow 4G
- Images with only
width: 100%and no aspect-ratio - Cookie banner injected above H1 after hydrate
- Font via CDN
@importin global CSS - A/B test changing hero height without reservation
- Lazy mid-article component without min-height
- Ignoring iframes (maps, booking calendars)
FAQ
Does CLS affect SEO in 2026?
Yes, as part of Core Web Vitals (page experience). Weak CLS rarely “kills” rankings alone, but in competitive SERPs and with similar content, UX quality matters. CTA misclicks hurt conversion immediately.
Does loading="lazy" cause CLS?
Lazy itself does not. Missing reserved space when the image appears does. Always use a known height / ratio box.
What about animations?
Transform/opacity are fine. Animating top/height/margin on in-flow elements causes shift. Prefer transform.
App Router vs Pages, does CLS differ?
Same metric. App Router can be sensitive to late client components and streaming: do not stream an above-the-fold block that changes height after hydration.
CTA
Red CLS on mobile, or a jumping hero after cookie/chat? We will measure CrUX, fix the layout, and add monitoring.
About the author
We build fast websites, web/mobile apps, AI chatbots and hosting setups — with a focus on SEO and conversion.
Recommended links
From theory to production — Branchly, our hosting stack and shipped work.
