# window-state

> WindowState React component. scrollTop and window dimensions on demand

Latest version **1.1.2** (published 2017-04-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install window-state
pnpm add window-state
yarn add window-state
bun add window-state
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2017-04-20 |
| First published | 2017-03-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 20 |
| Author | Kye Hohenberger |
| Maintainers | tkh44 |
| Keywords | react-component, react, window, size, dimensions, scroll |

## Links

- npm: https://www.npmjs.com/package/window-state
- Repository: https://github.com/tkh44/window-state
- Homepage: https://github.com/tkh44/window-state#readme
- Issues: https://github.com/tkh44/window-state/issues
- npm.io page: https://npm.io/package/window-state

## Dependencies (2)

- [fbjs](https://npm.io/package/fbjs.md) ^0.8.9
- [simple-listen](https://npm.io/package/simple-listen.md) ^1.1.2

## 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.1.2 (latest) — 2017-04-20
- 1.1.1 — 2017-03-24
- 1.1.0 — 2017-03-10
- 1.0.2 — 2017-03-09
- 1.0.1 — 2017-03-09

## README

# WindowState

[![Travis][build-badge]][build]
[![npm package][npm-badge]][npm]


In an idea taken from [react-virtualized](https://github.com/bvaughn/react-virtualized), all of the `scroll` events are handled by **ONE** listener.

_Each instance of the component does have a resize listener_

```jsx
<WindowState includeScrollbars={false}>
  ({ scrollTop, winHeight, winWidth }) => {
    console.log(scrollTop)
    return (<div style={{ height: winHeight, width: winWidth }} />)
  }
</WindowState>
```

[build-badge]: https://img.shields.io/travis/user/repo/master.png?style=flat-square
[build]: https://travis-ci.org/tkh44/window-state

[npm-badge]: https://img.shields.io/npm/v/npm-package.png?style=flat-square
[npm]: https://www.npmjs.org/package/window-state

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