# use-scroll-breakpoint

> react-hooks, an fancy way to get the relation between element.scrollTop and breakpoint

Latest version **1.1.2** (published 2021-09-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install use-scroll-breakpoint
pnpm add use-scroll-breakpoint
yarn add use-scroll-breakpoint
bun add use-scroll-breakpoint
```

## 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.1.2 |
| Published | 2021-09-27 |
| First published | 2021-06-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Yrobot |
| Maintainers | yrobot |
| Keywords | yrobot, react, hooks, scroll, breakpoint, listener |

## Links

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

## 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) — 2021-09-27
- 1.1.1 — 2021-09-27
- 1.1.0 — 2021-09-27
- 1.0.1 — 2021-06-03
- 1.0.0 — 2021-06-03

## README

# use-scroll-breakpoint

[
![](https://img.shields.io/github/size/yrobot/use-scroll-breakpoint/lib/index.js)
![](https://img.shields.io/github/issues/yrobot/use-scroll-breakpoint)
![](https://img.shields.io/github/stars/yrobot/use-scroll-breakpoint)
](https://github.com/yrobot/use-scroll-breakpoint)

react hooks, 快速获取滚动状态  
快速实现 stikcy 效果  
小而精

## install

### npm

```
yarn add use-scroll-breakpoint
```

or

```
npm install use-scroll-breakpoint
```

## usage

```js
import useScrollBreakpoint from 'use-scroll-breakpoint';

const App = () => {
  // isBreak: window.scrollTop > 500
  const [isBreak] = useScrollBreakpoint({
    breakpoint: 500,
  });
  return <div className='app'>...</div>;
};
```

## demo on codesandbox

[react demo](https://codesandbox.io/s/use-scroll-breakpoint-demo-krmmt)

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