Skip to content

a-box

BoxElement

An a-box element provides an interface to the resize events of a single element. For performance reasons, it uses a single ResizeObserver to observe all a-box elements on the page. Resize events are debounced by default.

Attributes


Name Type Default value Description
retain boolean false

Whether to retain the size of the element while resizing.

Events


Name Description
resize

Dispatched when the element is resized.

Methods


BoxElement.resize()

src/Box.ts:54

Called for a resize event.

Example

<a-box onResize={() => {
console.log("update something based on the layout")
}}>
...
</a-box>