{"library":"scroll-utility","title":"scroll-utility","description":"Simple scroll utility for centering elements and smooth animations. v4.0.2 is the latest stable release (May 2019). Provides a Scroll class to control scroll on any element with customizable easing, duration, and onScroll callbacks. Supports both absolute scrollTo and relative scrollBy with sub-methods for elements, sizes, and scroll sizes. Ships TypeScript types. Differentiators: handles multiple simultaneous animations, detects programmatic vs user scroll, reacts to element position changes, high performance, and works in both Node and browser environments. Designed for precise control over scroll behavior in web applications, with a clean API that avoids common pitfalls of native scroll.","language":"javascript","status":"active","last_verified":"Fri May 01","install":{"commands":["npm install scroll-utility"],"cli":null},"imports":["import { Scroll } from 'scroll-utility'","import { ScrollManager } from 'scroll-utility'","const scrollUtility = window.ScrollUtility; const Scroll = scrollUtility.Scroll;"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { Scroll } from 'scroll-utility';\n\nconst scrollManager = new Scroll();\n\n// Scroll to a specific pixel position\nscrollManager.scrollTo(500);\n\n// Smooth scroll to an element and center it\nscrollManager.scrollTo.element('#my-element', 0.5, 1000);\n\n// Scroll relative\nscrollManager.scrollBy(200);\n\n// Get current scroll position\nconst pos = scrollManager.scrollPosition();\n\n// Create a manager for a specific scrollable container\nconst container = document.querySelector('.scrollable');\nconst containerManager = new Scroll(container);\ncontainerManager.scrollTo.scrollSize(1); // scroll to bottom","lang":"typescript","description":"Demonstrates basic scroll operations: scrolling to position, centering an element, relative scrolling, and creating a manager for a specific container.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}