{"repo":"scroll-into-view/scroll-into-view-if-needed","free":true,"listed":false,"github":"https://github.com/scroll-into-view/scroll-into-view-if-needed","clone":"git clone https://github.com/scroll-into-view/scroll-into-view-if-needed.git","description":"Element.scrollIntoView ponyfills for things like \"if-needed\" and \"smooth\"","language":"JavaScript","stars":1450,"topics":["ponyfill","scrolling","animation","smooth-scrolling","typescript","polyfill","scrollintoview","scroll-into-view","smooth","smoothscroll"],"license":"MIT","category":"dev-tools","readme_excerpt":"[![gzip size][gzip-badge]][unpkg-dist] [![size][size-badge]][unpkg-dist] This used to be a ponyfill for Element.scrollIntoViewIfNeeded . Since then the CSS working group have decided to implement its features in Element.scrollIntoView as the option scrollMode: \"if-needed\" . Thus this library got rewritten to implement that spec instead of the soon to be deprecated one. - Demo - Install - Usage - Ponyfill smooth scrolling - Load time - Consistency - Quality - API - [scrollIntoView(target, \\[options\\])](#scrollintoviewtarget-options) - options - behavior - 'auto' - 'smooth' - Function - block - inline - scrollMode - boundary - skipOverflowHiddenElements - TypeScript support - Breaking API changes from v1 - v1 - v2 - centerIfNeeded - v1 - v2 - duration - v1 - v2 - easing - handleScroll - offset - [scrollIntoViewIfNeeded(target, \\[centerIfNeeded\\], \\[animateOptions\\], \\[finalElement\\], \\[offsetOptions\\])](#scrollintoviewifneededtarget-centerifneeded-animateoptions-finalelement-offsetoptions) - Related packages - Who's using this - Sponsors Demo Install You can also use it from a CDN: Usage Ponyfill smooth scrolling What does ponyfilling smooth scrolling mean, and why is it implemented in smooth-scroll-into-view-if-needed instead? The answer is bundlesize. If this package adds smooth scrolling to browsers that's missing it then the overall bundlesize increases regardless of wether you use this feature or not. Put it this way: That's why only native smooth scrolling is supported ou","default_branch":null,"files":null,"tree":[],"storefront":"/r/scroll-into-view","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/scroll-into-view/scroll-into-view-if-needed/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."}