New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@reach/window-size

Package Overview
Dependencies
Maintainers
4
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reach/window-size

Measure the window size in React

0.18.0
latest
Source
npm
Version published
Weekly downloads
9.5K
9.91%
Maintainers
4
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 13 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts