Resize Observer Playground - Online Watch Element Size
Drag to resize a box and see the Resize Observer callback fire. Get contentRect and borderBoxSize. Learn the API.
UD5 Toolkit
Real-time monitoring of element size changes using ResizeObserver API
Drag the bottom-right corner to resize, or use the sliders below. Use the sliders below to adjust element size.
window.resize event (which only fires when the entire viewport resizes), ResizeObserver can track size changes on any individual element—even those caused by CSS changes, dynamic content loading, or JavaScript manipulation. It's widely supported in all modern browsers (Chrome 64+, Firefox 69+, Safari 13.1+, Edge 79+).
window.resize only fires when the entire browser viewport changes size. In contrast, ResizeObserver watches individual DOM elements and detects size changes caused by any reason: CSS media queries, flex/grid layout recalculations, content insertion/removal, JavaScript DOM manipulation, or even CSS animations. This granularity makes it ideal for responsive components and dynamic layouts.
setInterval to check dimensions), ResizeObserver uses a callback-based model that fires only when actual size changes occur. The callbacks are batched and delivered in the same microtask, minimizing layout thrashing. For most use cases, the performance impact is negligible. However, avoid performing heavy synchronous work inside the callback—use requestAnimationFrame if you need to defer expensive operations.
observer.unobserve(element) to stop watching a specific element, or observer.disconnect() to stop observing all elements and release the observer entirely. It's good practice to call disconnect() when the observed element is removed from the DOM or when your component unmounts, to prevent memory leaks.
entry.contentRect.width and entry.contentRect.height are sufficient and have the broadest browser support.
Drag to resize a box and see the Resize Observer callback fire. Get contentRect and borderBoxSize. Learn the API.
Make an element resizable horizontally, vertically, or both. See the handle and code. Useful for textareas.
Explore the size‑container and inline‑size CSS properties for container queries. Understand containment contexts. Visual guide.
Enter two tire sizes and see a side‑by‑side comparison of diameter, width, and speedometer error. Local math.
Type a few words and see them rendered at every heading size (h1–h6) with your chosen font. Perfect for design systems.
Estimate your one‑rep max (1RM) from weight and reps. Supports multiple formulas (Epley, Brzycki). Training percentages table.
Add appliances with running and starting watts to estimate needed generator capacity. Prevent overload.
Enter a chemical formula (e.g., H2O, C6H12O6) and calculate its molar mass. Handles parentheses and hydrates. Pure frontend.
Estimate your one‑rep max from weight and reps. Supports Epley, Brzycki, Lombardi formulas. See your strength level.
Type a password and see a bar that fills based on estimated bits of entropy. Color‑coded feedback. No storage.
Toggle print‑specific styles like removing backgrounds, showing link URLs, and adding page breaks. Generate a complete print stylesheet instantly.
Find your healthy weight range using multiple medical formulas (Hamwi, Devine, Robinson, Miller). Frame size adjustment included. Instant local computation.
Calculate your one-rep max using Epley, Brzycki, Lombardi or O'Conner formulas. Predict maximum lifting capacity and plan progressive overload. 100% local processing.
Add print styles like removing backgrounds, adding page breaks, setting margins. See print preview instantly.
Paste a raw WebAuthn attestation response (CBOR) and decode its fields: format, authenticator data, and extensions. Debug passkeys locally.
Upload a small image and generate the CSS code for a custom cursor. Test it live on the page. Tiny but useful.
Enter a URL and click to check if it's reachable from your browser (CORS-limited, uses no-cors fetch). Quick manual test. Local only.
See exact mm and inch dimensions of ISO A-series and US paper sizes. Visual comparison tool. Also calculates weight based on GSM and dimensions.
See your current push subscription details. Trigger push and notificationclick events manually to debug.
Shrink a PDF file size with configurable image quality and object removal. All processing stays in your browser.
Highlight elements with aria‑describedby and see the linked description text. Verify a11y annotations.
See the current viewport width/height, document size, scrollbar width, and pixel ratio. Essential responsive data.
See a live readout of window scrollX and scrollY. Visualize scroll direction. For debugging sticky navs.
See the current Service Worker registration, its state, and scope. Send 'skipWaiting' and update. PWA debug.
Load an image and see the exact events fired (load, error, abort). Monitor progress. Dev helper.
Fill in a form and see the FormData object as JSON. Perfect for debugging multipart form submissions. Client-side.
See the current AudioContext state (suspended, running). Resume it with a button. Understand autoplay policies.
Connect a MIDI controller and see every message in a log. Filter by channel and type. Essential for debugging music apps.
Test required, pattern, minlength etc. See validity states and custom error messages. Learn browser‑native validation.
Adjust root, margin, and threshold. See a live log of intersection events as you scroll. Debug lazy loading.