# use-overflow

> A React Hook that allows you to detect X and Y overflow

Latest version **1.2.0** (published 2023-04-08) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2023-04-08 |
| First published | 2020-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 25.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Anthony Morris |
| Maintainers | amorrisc0de |

## Links

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

## Recent versions

- 1.2.0 (latest) — 2023-04-08
- 1.1.0 — 2020-12-06
- 1.0.2 — 2020-05-17

## README

# use-overflow

> A React Hook that allows you to detect X and Y overflow.

[![NPM](https://img.shields.io/npm/v/use-overflow.svg)](https://www.npmjs.com/package/use-overflow) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save use-overflow
OR
yarn add use-overflow
```

## Usage

[Check out the live example](https://amorriscode.github.io/use-overflow/).

```tsx
import * as React from 'react'

import { useOverflow } from 'use-overflow'

const Example = () => {
  const horizontalRef = React.useRef(null);
  const { refXOverflowing, refXScrollBegin, refXScrollEnd } = useOverflow(horizontalRef);

  const verticalRef = React.useRef(null);
  const { refYOverflowing, refYScrollBegin, refYScrollEnd } = useOverflow(verticalRef);

  return (
    <div>
      {/* Conditional do stuff based on overflow! */}
    </div>
  )
}
```

## License

MIT © [amorriscode](https://github.com/amorriscode)

---

This hook is created using [create-react-hook](https://github.com/hermanya/create-react-hook).

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