I'm trying to understand cumulative layout shifts. Are they just related to unexpected behaviour (for example, Javascript rewriting CSS or sizes), or does that include intentional shifts such as search bars that expand when the user clicks?

For example, Github's search bar: enter image description here

enter image description here

That can be seen in Gitlab as well.

Also, another question, regardless of what Google defines CLS metric, is it considered a good experience when the UI moves (not micro interactions)? I always had the intuition that good UI for productivity apps should move as minimum as possible, but I don't know if there is any science behind this

1 Answer 1


Cumulative Layout Shift (or CLS) is a measure of how much a webpage unexpectedly shifts during its life. For example, if a website visitor loaded a page and, while they were reading it, a banner loads and the page jumps down, that would constitute a large CLS score.

So no, intentional shifts do not count. It only accounts for things that load slower than others and will shift the page in a direction.

As for your second question ... it depends on the user experience and if it's making sense for the user. In your example, the search will expand in size to give the user more focus and work area and it makes sense. It doesn't have a search button that moves with that. If there would be a search button that changes it's position when the user clicks the search then that would not be good.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.