Resize Observer
<cs-resize-observer>
Resize observers watch their slotted elements for size changes and emit an event when they occur. Provides a thin, declarative interface to the browser's ResizeObserver API.
0 × 0
The resize observer will report changes to the dimensions of the elements it wraps through the cs-resize event. When emitted, event.detail.entries holds a collection of ResizeObserverEntry objects describing the observed elements and their new dimensions.
API
Importing
If you're using the autoloader or a hosted project, components load on demand — no manual import needed. To cherry-pick this component, use one of the following snippets.
import '@cruglobal/cornerstone-components/components/resize-observer/resize-observer.js';
import './cornerstone/components/resize-observer/resize-observer.js';
import CsResizeObserver from '@cruglobal/cornerstone-components/react/resize-observer/index.js';
Slots
Learn more about using slots.
| Name | Description |
|---|---|
| (default) | One or more elements to watch for resizing. |
Attributes & Properties
Learn more about attributes and properties.
| Property | Attribute | Description | Type | Default | Reflects |
|---|---|---|---|---|---|
disabled | disabled | Disables the observer. | boolean | false | Yes |
Events
Learn more about events.
| Name | Description |
|---|---|
cs-resize | Emitted when the element is resized. |

