Skip to content
Nana UI

Resize Observer

Watches its slotted content for size changes via ResizeObserver and emits nana-resize with the observer entries. Useful for building container-aware layouts and reacting to element resizes without wiring observers by hand.

Resizable content
Terminal window
npm install @nana-tec/ui-components
import "@nana-tec/ui-components/resize-observer";
<nana-resize-observer>
<div>Resizable content</div>
</nana-resize-observer>
PropertyTypeDefaultDescription
boxResizeObserverBoxOptions'content-box'Which box model to observe
disabledbooleanfalseStop observing
EventTypeDescription
nana-resizeCustomEventFired on resize (detail.entries, detail.contentRect)
SlotDescription
(default)The content to observe
Explore Resize Observer interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook