Resize Observer watches an element rather than the viewport. A component can adapt to its available space even when only its parent panel changes size.
The demo panel resizes automatically and the measurement follows. Changing size immediately in its callback can create repeated notifications, so plan the update flow.
When to use
Use it to fit a chart or canvas to its parent container.