ResizeObserver fires when a watched element’s content rect changes size. It is the right tool for component-level responsiveness when container queries do not cover the use case.
Watch for the ‘ResizeObserver loop limit exceeded’ warning: it usually means a callback synchronously triggered another layout. Defer state updates with requestAnimationFrame if you see it.
Combine it with devicePixelContentBoxSize for canvas elements that need to redraw at the right resolution after a window zoom or DPR change.