Cumulative Layout Shift (CLS)
You'll learn how CLS measures the total of all unexpected layout shifts during a page's lifecycle and why maintaining visual stability is crucial for user experience.
What Is CLS?
Cumulative Layout Shift (CLS) is a metric that sums up all the individual layout shift scores that occur during the entire time a user interacts with your page. Unlike LCP or FID/INP which measure single moments, CLS accumulates every time content unexpectedly moves after the page has started rendering.
Think of it like counting how many times someone bumps your elbow while you're trying to write—each bump throws you off, and the more bumps that happen, the worse your overall experience becomes.
How It Works
CLS adds together every layout shift score calculated from the impact fraction (how much viewport area was affected) and the distance fraction (how far elements moved). The metric starts at 0 when the page loads and increases whenever unexpected shifts happen—whether that's 100ms after load or 5 minutes later when the user is still reading.
The Target Score
The goal is to keep CLS below 0.1 for a "good" experience. A score between 0.1 and 0.25 needs improvement, and anything above 0.25 is considered poor.
This threshold means your page should have minimal cumulative shifting. Every shift adds to the total, so preventing shifts throughout the page lifecycle—not just during initial load—is essential.
Why It's Different
Unlike metrics that capture a single point in time, CLS is cumulative and ongoing. A page might load perfectly but still have a terrible CLS score if elements shift when images lazy-load, ads inject, or dynamic content appears later.
Key Takeaway: CLS measures the sum of all unexpected layout shifts during a page's entire lifecycle, targeting a score below 0.1 to ensure users don't experience jarring content movements that disrupt their interaction.