# react-hooks-window-size

> A react hooks approach to window resize events

Latest version **0.3.0** (published 2023-05-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-hooks-window-size
pnpm add react-hooks-window-size
yarn add react-hooks-window-size
bun add react-hooks-window-size
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2023-05-02 |
| First published | 2018-12-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Garth Williams |
| Maintainers | garthw |
| Keywords | react, window, size, resize, hooks |

## Links

- npm: https://www.npmjs.com/package/react-hooks-window-size
- Repository: https://github.com/garth/react-hooks-window-size
- Homepage: https://github.com/garth/react-hooks-window-size#readme
- Issues: https://github.com/garth/react-hooks-window-size/issues
- npm.io page: https://npm.io/package/react-hooks-window-size

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.5.0

## 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

- 0.3.0 (latest) — 2023-05-02
- 0.2.2 — 2020-03-11
- 0.2.1 — 2020-03-11
- 0.2.0 — 2020-03-11
- 0.1.0 — 2018-12-23

## README

# react-hooks-window-size

A react hooks approach to window resize events.

## Install

```
yarn add react-hooks-window-size
```

or

```
npm install react-hooks-window-size
```

## Usage Example

```tsx
import React from 'react'
import { useWindowSize } from 'react-hooks-window-size'

const App: React.StatelessComponent = () => {
  const size = useWindowSize(/* 1280, 1024 */) // optionally pass in size values for server side rendering

  return (
    <p>
      The window is currently {size.width}px by {size.height}px.
    </p>
  )
}

export default App
```

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