<aside> 💡 The Cumulative Layout Shift (CLS) is an important metric of user experience. It measures visual stability by quantifying the extent to which users will encounter unexpected changes to the page layout.
</aside>
If you've ever read an article where all the content suddenly shifts without you doing anything, or worse, you try to click on a button and it shifts, then you've experienced a page with a bad CLS.
CLS helps by measuring how often this happens to users on your site.
The CLS measures the sum of the scores of unexpected shifts over the lifetime of the page.
A shift occurs when a visible element changes its position on the page.
The score depends on the size of the element and the offset distance.