Performance
Cumulative Layout Shift (CLS): stop the page from jumping
CLS measures how much content moves while the page loads. A score of 0.1 or less earns full points; above 0.25 earns none. Reserve space for everything.
- Category
- Performance
- Points available
- 3 pts · PageSpeed only
- Effort
- Medium effort
Why it matters
When text jumps as an image or banner loads, people lose their place or tap the wrong button. It feels broken and costs conversions.
CLS is a Core Web Vital, so Google uses it as a page experience signal.
How we measure it
Scored only with PageSpeed data. We read the CLS value from a mobile Lighthouse run in PageSpeed Insights.
If PageSpeed returns no CLS value, you get partial points. Without PageSpeed data this check is not scored.
| Result | Without PageSpeed | With PageSpeed |
|---|---|---|
| 0.1 or less | not scored | 3 |
| 0.1-0.25 | not scored | 2 |
| PageSpeed returned no value | not scored | 2 |
| More than 0.25 | not scored | 0 |
Performance weights change when PageSpeed Insights data is available: TTFB, HTML size and redirects then share the 22 performance points with LCP, CLS and INP.
How to fix it
- Give every image and video
widthandheightattributes (or a CSSaspect-ratio) so the browser reserves the space. - Reserve a fixed-size slot for ads, embeds and cookie banners before they load.
- Do not insert banners above existing content after load. Overlay them or reserve their space.
- Load web fonts with
font-display: swapand a metric-matched fallback (next/font does this for you).
Copy-paste fixes
<!-- Width and height let the browser reserve space before the image loads -->
<img src="/img/chart.png" alt="Sales by month" width="800" height="450" style="height:auto;max-width:100%">
<!-- Reserve space for embeds and ads that load later -->
<div style="aspect-ratio:16/9">
<iframe src="https://www.youtube-nocookie.com/embed/VIDEO_ID" title="Product demo"
style="width:100%;height:100%;border:0" loading="lazy"></iframe>
</div>import { Inter } from "next/font/google";
// next/font self-hosts the font and adds a size-adjusted fallback, so text does not jump when it swaps.
const inter = Inter({ subsets: ["latin"], display: "swap" });
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en" className={inter.className}>
<body>{children}</body>
</html>
);
}Common mistakes
- Setting
height:autoon images without thewidth/heightattributes. - A cookie banner or promo bar that pushes the whole page down after a second.
- Animating
toporheightinstead oftransform.
Test your site now
Put your site against a competitor and see how many of these points you earn, and which fixes pay off first.