element-size

Get the size of an element in pixels, including margins

Usage no npm install needed!

<script type="module">
  import elementSize from 'https://cdn.skypack.dev/element-size';
</script>

README

element-size stable

Get the size of an element in pixels, including margins

Usage

NPM

[width, height] = size(element)

Given a DOM element, return an array containing that element's width and height in pixels.

License

MIT. See LICENSE.md for details.