# react-usegetscreen

> Hook for determining what screen size you have

Latest version **1.1.5** (published 2020-11-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-usegetscreen
pnpm add react-usegetscreen
yarn add react-usegetscreen
bun add react-usegetscreen
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.5 |
| Published | 2020-11-07 |
| First published | 2020-11-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Daryl Moulder, Calin Ortan |
| Maintainers | dmoulder |
| Keywords | react, screen, responsive |

## Links

- npm: https://www.npmjs.com/package/react-usegetscreen
- Repository: https://github.com/calinortan/react-getscreen
- Homepage: https://github.com/calinortan/react-getscreen#readme
- Issues: https://github.com/calinortan/react-getscreen/issues
- npm.io page: https://npm.io/package/react-usegetscreen

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.20

## 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.5 (latest) — 2020-11-07
- 1.1.4 — 2020-11-07

## README

### REACT-USEGETSCREEN

This package provides a hook to provide some functions that you can use to determine the 
type of screen.  Mobile `isMobile`, Tablet `isTablet`, Desktop `isDesktop`

###### Install
```
npm install react-usegetscreen --save
yarn add react-usegetscreen
```

###### Example

```
import React, { Component } from "react";
import useGetScreen from "react-usegetscreen";

class Test = () => {
    
    { isMobile, isTablet, isDesktop } = useGetScreen();

    if (isMobile()) return <div>Mobile</div>;
    if (isTablet()) return <div>Tablet</div>;
    return <div>Desktop</div>;
}

export default Test;
```

It supports an options object containing following props:
- mobileLimit - Max width for mobile display. default = 468
- tabletLimit - Max width for tablet display. default=768
- shouldListenOnResize - Boolean describing whether it should listen on screen resize. default=true

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