@reach/window-size
TypeScript icon, indicating that this package has built-in type declarations

0.18.0 • Public • Published

@reach/window-size

Stable release MIT license

Docs | Source

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>
	);
}

/@reach/window-size/

    Package Sidebar

    Install

    npm i @reach/window-size

    Weekly Downloads

    9,355

    Version

    0.18.0

    License

    MIT

    Unpacked Size

    12.9 kB

    Total Files

    10

    Last publish

    Collaborators

    • ryanflorence
    • mjackson
    • chancestrickland
    • blainekasten