# react-window-size

> React HOC that passes browser window size to wrapped component

Latest version **1.2.2** (published 2018-08-17) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2018-08-17 |
| First published | 2017-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/react-window-size) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 12.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 35 |
| Author | Finn Fitzsimons |
| Maintainers | finnfiddle |
| Keywords | react-component, react, hoc, browser, window, size, reactive |

## Links

- npm: https://www.npmjs.com/package/react-window-size
- Repository: https://github.com/finnfiddle/react-window-size
- Issues: https://github.com/finnfiddle/react-window-size/issues
- npm.io page: https://npm.io/package/react-window-size

## Dependencies (1)

- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.6.1

## 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.2.2 (latest) — 2018-08-17
- 1.2.1 — 2018-08-16
- 1.2.0 — 2018-05-04
- 1.0.1 — 2017-08-19
- 1.1.0 — 2017-06-27
- 1.0.0 — 2017-02-08

## README

# React Window Size

A higher-order React component that passes the browser window's dimensions as props to the wrapped component.

Example:

```javascript
import React, { Component } from 'react';
import windowSize from 'react-window-size';

class ScreenSize extends Component {

  render() {
    return (
      <p>
        Screen width is: {this.props.windowWidth}
        <br />
        Screen height is: {this.props.windowHeight}
      </p>
    );
  }

}

export default windowSize(ScreenSize);
```

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