HTML containertiming Global Attribute
The containertiming attribute marks an element as a container whose paint timing is reported by the Container Timing API. It is experimental.
Description
The containertiming global attribute marks an element as a container root for the Container Timing API. The browser then reports when new content is painted inside the element's subtree, so a page can measure how long it takes for an important area, such as a hero section or a list of products, to be fully rendered. It works like Largest Contentful Paint, but for a part of the page chosen by the developer.
Paints to new areas inside the container count towards its timing; repaints of areas that were already painted, and content painted by the root element itself, do not. Entries are only reported until the user scrolls or interacts with the page.
The value is a string that identifies the container. It is returned as the identifier property of the PerformanceContainerTiming entries, which are read with a PerformanceObserver using the "container" type. In the DOM the attribute is reflected as element.containerTiming. Use containertimingignore to leave parts of a container out of the measurement.
new PerformanceObserver((list) => {
for (const entry of list.getEntries()) {
console.log(entry.identifier, entry.startTime);
}
}).observe({ type: "container", buffered: true });
Syntax
<element containertiming="identifier">
Values
- identifierA string that names the container. It is returned in
PerformanceContainerTiming.identifier.
Example
Browser Support
The following information will show you the current browser support for the HTML containertiming global attribute. Hover over a browser icon to see the version that first introduced support for this HTML global attribute.
Desktop





Tablets & Mobile





