1.0.6 • Published 4 years ago

use-scroll-bar v1.0.6

Weekly downloads
9
License
MIT
Repository
github
Last release
4 years ago

use-scroll-bar

Build Status

Get information of window scrollbar like current position and direction of last scroll.

How to use?

import React from 'react'
import { useScrollbar } from 'use-scroll-bar'


function App() {

	const scrollState = useScrollbar({ delay: 200 })

	retrun (
		<div>
			User has scrolled {scrollState.directionX}
		</div>
	)
}

What this hook return?

{
	directionX: 'left' || 'right',
	directionY: 'up' || 'down',
	scrollX: number,
	scrollY: number
}
1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago