Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

element-size

hughsk875.5kMIT1.1.1TypeScript support: definitely-typed

Get the size of an element in pixels, including margins

element, dom, browser, browserify, node, dimensions, margin

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.