@reach/window-size
Measure the window size in React
Last updated 6 years ago by mjackson .
MIT · Original npm
$ cnpm install @reach/window-size 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.10.3                                ...           latest (5 years ago)
  • 0.4.0-beta.0                                ...           next (6 years ago)

3 Versions

  • 0.4.0-beta.0                                ...           6 years ago
  • 0.10.3                                ...           5 years ago
  • 0.4.0                                ...           6 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org