# `useMeasure` React sensor hook that tracks dimensions of an HTML element using the [Resize Observer API](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver). ## Usage ```jsx import { useMeasure } from "react-use"; const Demo = () => { const [ref, { x, y, width, height, top, right, bottom, left }] = useMeasure(); return (
x: {x}
y: {y}
width: {width}
height: {height}
top: {top}
right: {right}
bottom: {bottom}
left: {left}
); }; ``` ## Related hooks - [useSize](./useSize.md)