react-spring-scroll-hook
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

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>

Readme

Keywords

none

Package Sidebar

Install

npm i react-spring-scroll-hook

Weekly Downloads

7

Version

0.3.0

License

MIT

Unpacked Size

29.4 kB

Total Files

16

Last publish

Collaborators

  • nucleartux