# use-breakpoints

> Custom react hooks

Latest version **0.0.7** (published 2019-01-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install use-breakpoints
pnpm add use-breakpoints
yarn add use-breakpoints
bun add use-breakpoints
```

## Health

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

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2019-01-11 |
| First published | 2018-12-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | vsymonenko |
| Maintainers | symonenko |
| Keywords | react, hooks |

## Links

- npm: https://www.npmjs.com/package/use-breakpoints
- Repository: https://github.com/VSymonenko/useBreakpoints
- Homepage: https://github.com/VSymonenko/useBreakpoints#readme
- Issues: https://github.com/VSymonenko/useBreakpoints/issues
- npm.io page: https://npm.io/package/use-breakpoints

## Dependencies (1)

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

- 0.0.7 (latest) — 2019-01-11
- 0.0.6 — 2019-01-09
- 0.0.5 — 2019-01-09
- 0.0.4 — 2019-01-09
- 0.0.3 — 2019-01-09
- 0.0.2 — 2019-01-09
- 0.0.1 — 2018-12-27

## README

# useBreakpoints
Custom react hooks

📺 [Live Demo](https://codesandbox.io/s/j4npjjy70y/)

## 🔧 Installation

`npm i -S use-breakpoints`

## 📗 How to use

> Note! Use only in functional component. See [rule](https://reactjs.org/docs/hooks-rules.html#only-call-hooks-from-react-functions)

### Use default:

```javascript
import React from 'react'
import useBreakpoints from 'use-breakpoints'

export default function Component() {
  const breakpoints = useBreakpoints()

  return <div>screen: {breakpoints.screen}</div>
}
```

### Customization:

```javascript
import React from 'react'
import useBreakpoints from 'use-breakpoints'

export default function Component() {
  const test = {
    extraSmall:	{
      min: 0,
      max: 600
    },
    small: {
      min: 601,
      max: 960
    },
    large: {
      min: 961,
      max: 1280
    },
    extraLarge: {
      min: 1281,
      max: null
    },
  }

  const breakpoints = useBreakpoints(test)

  return <div>screen: {breakpoints.screen}</div>
}
```

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