{"repo":"n8tb1t/use-scroll-position","free":true,"listed":false,"github":"https://github.com/n8tb1t/use-scroll-position","clone":"git clone https://github.com/n8tb1t/use-scroll-position.git","description":"Track Scroll Like a Pro – React Hook for Smooth UI","language":"TypeScript","stars":629,"topics":["react","hooks","react-hooks","scroll","scroll-position","use-scroll-position"],"license":"MIT","category":"ui-components","readme_excerpt":"use-scroll-position use-scroll-position is a lightweight, tree-shakable React hook library for detecting and tracking scroll position — either of the window or a specific element . Designed for performance-sensitive use cases. ⚡️ Version 4.0.0 is a complete rewrite of the library. For older versions, see the legacy docs. --- ⚡️ Quickstart Track the global window scroll position in just a few lines: --- 📖 Documentation 👉 Full Docs Site - useWindowScrollPosition – track global window scroll or specific element position. - useBodyScrollPosition – similar to window scroll, with a different detection method. - useOverflowScrollPosition – track scroll inside an overflow container (supports root + child target refs). --- ✨ Features - ✅ React 19 support - ✅ SSR-ready - ✅ LLM-friendly docs - ✅ Native TypeScript --- 📦 Installation Using NPM : Using PNPM : --- 🚀 Usage Track window scroll position --- Track element position in the viewport (window) --- Track scroll position in an overflow container --- Track element scroll position inside an overflow container --- 💡 Use Cases Here are some common ways developers use use-scroll-position : - Sticky Headers & Navbars – hide, reveal, or shrink navigation bars depending on scroll direction. - Infinite Scrolling – detect when the user reaches the bottom of a container or the window to load more data. - Scroll-Based Animations – trigger animations or transitions as elements enter the viewport. - Active Section Highlighting – update navigat","default_branch":null,"files":null,"tree":[],"storefront":"/r/n8tb1t","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/n8tb1t/use-scroll-position/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}