0.18.1 • Published 1 year ago

@reach-ui-fork/window-size v0.18.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@reach-ui-fork/window-size

Stable release MIT license

Docs | Source

Measure the current window dimensions.

import WindowSize, { useWindowSize } from "@reach-ui-fork/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>
	);
}