ERD is a renderless ResizeObserver wrapper that exposes the current element width and height to slot content.
Install the package:
yarn add @enso-ui/erdThe component can be used inside or outside the Enso ecosystem.
- exports a single renderless
Erdcomponent through the package root - observes the rendered element with
ResizeObserverand debounces updates - passes reactive
widthandheightvalues to the default slot - works well for responsive charts, virtualized layouts, and adaptive cards
<script setup>
import Erd from '@enso-ui/erd';
</script>
<Erd :debounce="50" v-slot="{ width, height }">
<div>{{ width }} × {{ height }}</div>
</Erd>Renderless component that observes its own element box and forwards the current size through the default slot.
Import: @enso-ui/erd
Props:
debounce: number = 1debounce window, in milliseconds, used before width and height updates are applied.
Events:
- none.
Slots:
defaultreceives{ width, height }with the latest observed content-box dimensions.
lodashfor the internal debounce helper.vueas the component runtime.
are welcome. Pull requests are great, but issues are good too.
Thank you to all the people who already contributed to Enso!