# react-hook-use-window-dimensions

> Get Browser Window Dimensions

Latest version **1.0.0** (published 2020-01-21) · MIT license · 0 weekly downloads

## Install

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

## 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.0 |
| Published | 2020-01-21 |
| First published | 2020-01-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Lars Hampe |
| Maintainers | hashdot |
| Keywords | react, hook, window |

## Links

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

## Dependencies (1)

- [react](https://npm.io/package/react.md) ^16.12.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

- 1.0.0 (latest) — 2020-01-21

## README

# React Hook - useWindowDimensions

[![NPM](https://badgen.net/npm/v/react-hook-use-window-dimensions)](https://www.npmjs.com/package/react-hook-use-window-dimensions)

Get Browser Window Dimensions

## Install

```
npm i react-hook-use-window-dimensions
```

## Usage

Simply use the hook and get the dimensions.

**Demo:**

[![Edit Demo](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-hook-use-window-dimensions-dqf07)

**Example.js**

```javascript
import React from "react"
import useWindowDimensions from "react-hook-use-window-dimensions"

export default function ExampleComponent({ children }) {
  const { width, height } = useWindowDimensions()
  return (
    <>
      <p>width: {width}</p>
      <p>height: {height}</p>
    </>
  )
}
```

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