The type of HTML element being observed, must extend HTMLElement
A React ref object pointing to the element to track, or a class name string
Optional configuration object
Initial width to use before the element is measured (defaults to 0)
Initial height to use before the element is measured (defaults to 0)
The current width and height of the element in pixels, or the defaults if the element is not yet mounted
A React hook that tracks the width and height of a DOM element using ResizeObserver.
Unlike
useWindowDimensions, this reflects the element's own size, so it matches container queries and works inside the admin page builder preview.