use-smooth-horizontal-scroll
Advanced tools
Comparing version 0.1.0 to 0.2.0
{ | ||
"name": "use-smooth-horizontal-scroll", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "This package provides a custom hook for smooth horizontal scrolling in React. The hook allows for setting a scroll container, handling scroll events, scrolling to a specific point, and determining if the user is at the start or end of the scrollable area.", | ||
@@ -5,0 +5,0 @@ "author": "progrmoiz", |
@@ -24,4 +24,6 @@ # Smooth Horizontal Scroll | ||
```tsx | ||
const { scrollContainerRef, handleScroll, scrollTo, isAtStart, isAtEnd } = useSmoothHorizontalScroll(); | ||
``` | ||
You'll need to pass the `scrollContainerRef` to the element you want to apply the smooth scrolling to, and attach the `handleScroll` function to the `onScroll` event of that element. | ||
@@ -28,0 +30,0 @@ |
9997
81