files/en-us/web/api/resizeobserversize/index.md
{{APIRef("Resize Observer API")}}
The ResizeObserverSize interface of the Resize Observer API is used by the {{domxref("ResizeObserverEntry")}} interface to access the box sizing properties of the element being observed.
[!NOTE] In multi-column layout, which is a fragmented context, the sizing returned by
ResizeObserverSizewill be the size of the first column.
[!NOTE] For more explanation of writing modes and block and inline dimensions, read Handling different text directions.
In this example the {{domxref("ResizeObserverEntry.contentBoxSize")}} property returns a ResizeObserverSize object. This is an array containing the sizing information for the content box of the observed element.
const resizeObserver = new ResizeObserver((entries) => {
for (const entry of entries) {
console.log(entry.contentBoxSize[0]); // a ResizeObserverSize
}
});
resizeObserver.observe(divElem);
{{Specifications}}
{{Compat}}