Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bhallstein/tiny-scrollto

Tiny 0.4kB animated scroll helper
https://github.com/bhallstein/tiny-scrollto

Last synced: about 2 months ago
JSON representation

Tiny 0.4kB animated scroll helper

Awesome Lists containing this project

README

        

# tiny-scrollto

Animate DOM scrolling. 0.4kB, zero dependencies.

**Install:**

```js
npm install -S tiny-scrollto
```

**Use:**

```js
import {scroll} from 'tiny-scrollto'

scroll(500)
scroll('end') // Scroll to end of document
```

`tiny-scrollto` also exports a `clamp` utility function:

```js
import {clamp} from 'tiny-scrollto'

const x = clamp(x, 0, 1) // Clamp x to the range 0-1
```