@reach/window-size
v0.18.0
Published
Measure the window size in React
Downloads
70,848
Keywords
Readme
@reach/window-size
Measure the current window dimensions.
import WindowSize, { useWindowSize } from "@reach/window-size";
function Example() {
const { width, height } = useWindowSize();
return (
<div>
<p>
Looks like a pretty{" "}
{width <= 400 ? "small" : width >= 1000 ? "large" : "normal"} screen!
</p>
</div>
);
}