# react-use-window-sizes

> A lightweight package to easily track window size in React.js

Latest version **1.0.3** (published 2022-02-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-use-window-sizes
pnpm add react-use-window-sizes
yarn add react-use-window-sizes
bun add react-use-window-sizes
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2022-02-02 |
| First published | 2022-02-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | hxf31891 |
| Maintainers | hxf31891 |
| Keywords | react, window-size, window-height, window-width, width, height, react-hooks |

## Links

- npm: https://www.npmjs.com/package/react-use-window-sizes
- Repository: https://github.com/hxf31891/react-use-window-sizes
- Homepage: https://github.com/hxf31891/react-use-window-sizes#readme
- Issues: https://github.com/hxf31891/react-use-window-sizes/issues
- npm.io page: https://npm.io/package/react-use-window-sizes

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2022-02-02
- 1.0.2 — 2022-02-02
- 1.0.1 — 2022-02-02
- 1.0.0 — 2022-02-02

## README

# useWindowSizes - a custom React hook
A lightweight package to easily track window width & height in React.js

Comes in handy for responsize design and animations

## Install
`npm install react-use-window-sizes`

## Example 
```js
import React from 'react'
import { useWindowSizes } from 'react-use-window-sizes'

function MyApp() {
  const { width, height } = useWindowSizes();
  console.log('width:', width, 'height:', height) 

}
```

---
_Source: https://npm.io/package/react-use-window-sizes · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
