The LayoutShift interface of the Performance API provides insights into the layout stability of web pages based on movements of the elements on the page.
Description
A layout shift happens when any element that is visible in the viewport changes its position between two frames. These elements are described as being unstable, indicating a lack of visual stability.
The Layout Instability API provides a way to measure and report on these layout shifts. All tools for debugging layout shifts, including those in the browser's developer tools, use this API. The API can also be used to observe and debug layout shifts by logging the information to the console, to send the data to a server endpoint, or to web page analytics.
Returns the layout shift score calculated as the impact fraction (fraction of the viewport that was shifted) multiplied by the distance fraction (distance moved as a fraction of viewport).
Returns the time of the most recent excluding input (user input that would exclude this entry as a contributor to the CLS score) or 0 if no excluding input has occurred.