0.3.0 • Published 4 years ago

react-spring-scroll-hook v0.3.0

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

react-spring-scroll-hook

Simple hook for creating smooth scroll list with arrows.

demo

Install

yarn add react-spring-scroll-hook

Example

import useSpringScroll from 'react-spring-scroll-hook';

const {
  ref,
  left: handlePrevClick,
  reset: handleWheel,
  right: handleRightClick
} = useSpringScroll({ step: 100 });

return <div>
  <img src={arrowPrevIcon} onClick={handlePrevClick} />

  <div className="overflow" onWheel={handleWheel}>
    {children}
  </div>

  <img src={arrowNextIcon} onClick={handleRightClick} />
</div>
0.3.0

4 years ago

0.2.0

4 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago