ElementSize

A function that returns the size of an element.

Demo

Usage

	<script lang="ts">
  import { ElementSize } from "runed";
 
  let el = $state() as HTMLElement;
  const size = new ElementSize(() => el);
</script>
 
<textarea bind:this={el}></textarea>
 
<p>Width: {size.width} Height: {size.height}</p>	
MIT

© 2024 Svecosystem Team