# seamless-scroll-polyfill

> Smooth Scroll behavior polyfill

Latest version **2.3.4** (published 2023-03-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install seamless-scroll-polyfill
pnpm add seamless-scroll-polyfill
yarn add seamless-scroll-polyfill
bun add seamless-scroll-polyfill
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.4 |
| Published | 2023-03-21 |
| First published | 2018-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 313.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 166 |
| Author | Dustan Kasten |
| Maintainers | magic-akari |
| Keywords | smooth, scroll, scrollIntoView, CSSOM, polyfill |

## Links

- npm: https://www.npmjs.com/package/seamless-scroll-polyfill
- Repository: https://github.com/magic-akari/seamless-scroll-polyfill
- Issues: https://github.com/magic-akari/seamless-scroll-polyfill/issues
- npm.io page: https://npm.io/package/seamless-scroll-polyfill

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 2.3.4 (latest) — 2023-03-21
- 2.1.1 (next) — 2021-09-11
- 2.3.3 — 2023-03-08
- 2.3.2 — 2023-03-08
- 2.3.1 — 2023-03-02
- 2.3.0 — 2023-01-26
- 2.2.1 — 2023-01-26
- 2.2.0 — 2022-06-24
- 2.1.8 — 2022-02-19
- 2.1.7 — 2022-02-17
- 2.1.6 — 2021-12-05
- 2.1.5 — 2021-10-25
- 2.1.4 — 2021-09-23
- 2.1.3 — 2021-09-20
- 2.1.3-beta.3 — 2021-09-20
- … 40 more at https://npm.io/package/seamless-scroll-polyfill/versions

## README

[![Build Status](https://travis-ci.org/magic-akari/seamless-scroll-polyfill.svg?branch=master)](https://travis-ci.org/magic-akari/seamless-scroll-polyfill)

This repo is forked from iamdustan/smoothscroll and rewritten with TypeScript.

## Installation and use

```sh
# npm
npm install seamless-scroll-polyfill --save

# yarn
yarn add seamless-scroll-polyfill
```

## Use polyfill to patch all methods

```js
import { polyfill } from "seamless-scroll-polyfill";

polyfill();
```

## Use specific polyfill

```js
import { elementScrollIntoViewPolyfill } from "seamless-scroll-polyfill";

elementScrollIntoViewPolyfill();
```

## Use methods directly without patching

```js
import { scrollIntoView } from "seamless-scroll-polyfill";

scrollIntoView(document.querySelector("#target"), { behavior: "smooth", block: "center", inline: "center" });
```

## Import via script

```html
<!-- please replace the `latest` with specific version -->
<script src="https://cdn.jsdelivr.net/npm/seamless-scroll-polyfill@latest"></script>
<script>
    // patch all methods
    seamless.polyfill();
    // or use specific methods
    seamless.scrollBy(window, { behavior: "smooth", top: 200, left: 0 });

    seamless.scrollIntoView(document.querySelector("#target"), {
        behavior: "smooth",
        block: "center",
        inline: "center",
    });
</script>
```

## Changelog

Detailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md).

## Thanks

-   [iamdustan/smoothscroll](https://github.com/iamdustan/smoothscroll)
-   [stipsan/compute-scroll-into-view](https://github.com/stipsan/compute-scroll-into-view)

---
_Source: https://npm.io/package/seamless-scroll-polyfill · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
