ResizeObserver Playground - Interactive Lab | IconVault
Drag-resize elements and watch contentRect, borderBoxSize and device pixels update live. Free, runs fully in your browser.
ResizeObserver Playground
Drag-resize elements and see box sizes live
box option.Drag the corner to resize
Every size change fires the observer callback.
Resizable box
ResizeObserver reports this element live.
No-drag demo: growing text
Live box sizes
Waiting for the first callback...
devicePixelContentBoxSize is what canvas renderers use to size backing stores at the right resolution; it needs no manual devicePixelRatio math.
Callback log
Resize the box.
Copy-ready code
const box = document.querySelector("#resizable");
const ro = new ResizeObserver((entries) => {
for (const entry of entries) {
console.log("contentRect:", entry.contentRect.width, entry.contentRect.height);
console.log("borderBoxSize:", entry.borderBoxSize[0].inlineSize, "x", entry.borderBoxSize[0].blockSize);
if (entry.devicePixelContentBoxSize[0])
console.log("device pixels:", entry.devicePixelContentBoxSize[0].inlineSize);
}
});
// "content-box" | "border-box" | "device-pixel-content-box"
ro.observe(box, { box: "content-box" });
// Later: ro.unobserve(box); ro.disconnect();5 of 5 free copies left.
About this tool
IconVault's ResizeObserver Playground makes element observation tangible: drag a box by its corner and watch contentRect, borderBoxSize and devicePixelContentBoxSize update live, switch the observed box model, and read every callback in the timestamped log. It is free to use and runs fully in your browser with nothing uploaded.
How to use: drag the resize handle, toggle between content-box, border-box and device-pixel-content-box, and try the no-drag growing-text demo. Perfect for developers building responsive components, canvas renderers and container-aware layouts.
Frequently asked questions
Popular searches
More tools
Algorithm Visualizer
Watch sorting and searching animate step by step
Alt Text Helper
Write better image alt text with live feedback
ARIA Reference
Searchable ARIA roles and attributes guide
Array Visualizer
Step through map, filter, reduce like a debugger
Coming soon
CLI
Coming soon
Figma plugin
Coming soon
VS Code extension
Coming soon
Chrome extension
Coming soon
AI icon generator
Coming soon
Team workspaces
Coming soon