# smoothscrolljs

> A lightweight JavaScript package for smooth scroll animation

Latest version **1.0.1** (published 2019-07-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install smoothscrolljs
pnpm add smoothscrolljs
yarn add smoothscrolljs
bun add smoothscrolljs
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-07-12 |
| First published | 2017-09-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 252.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Adrian Klimek |
| Maintainers | adrianklimek |

## Links

- npm: https://www.npmjs.com/package/smoothscrolljs
- Repository: https://github.com/adrianklimek/smoothscroll
- Issues: https://github.com/adrianklimek/smoothscroll/issues
- npm.io page: https://npm.io/package/smoothscrolljs

## Recent versions

- 1.0.1 (latest) — 2019-07-12
- 1.0.0 — 2018-12-25
- 0.1.3 — 2018-07-04
- 0.1.2 — 2018-06-10
- 0.1.1 — 2017-11-21
- 0.1.0 — 2017-09-04

## README

# Smooth Scroll
A lightweight JavaScript package form smooth scroll animation

## Installation

### Install with npm:
```
npm install smoothscrolljs
```

### Install with yarn:
```
yarn add smoothscrolljs
```

## Usage
```
import smoothScroll from 'smoothscrolljs'

const destinationEl = document.querySelector('.scroll-to')
smoothScroll(destinationEl)
```

### Parameters
| Name | Description | Type | Default |
| ---- | ----------- | ---- | ------- |
| destination | DOM element to scroll to or a position | HTMLElement, Number | - |
| opts | - | Object | - |
| opts.duration | - | Number | 600 |
| opts.easing | function or name of one of predefined easing functions ('linear', 'easeIn', 'easeOut', 'easeInOut') | Function, String | 'easeInOut' |
| opts.context | an element to apply scroll to | HTMLElement | window |
| opts.orientation | scroll orientation ('horizontal', 'vertical') | String | 'vertical' |
| opts.offset | scroll offset in px | Number | 0 |
| opts.onUpdate | a function that is called on every change | Function | - |
| opts.onComplete | a function that is called on animation end | Function | - |


## License
smoothscrolljs is licensed under [MIT license](https://opensource.org/licenses/MIT).

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