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

https://github.com/markmead/alpinejs-scroll-amount

Track the users scroll position and their progress on the page 🤿
https://github.com/markmead/alpinejs-scroll-amount

alpine-js alpinejs alpinejs-plugin alpinejs-scroll javascript-scroll

Last synced: 12 months ago
JSON representation

Track the users scroll position and their progress on the page 🤿

Awesome Lists containing this project

README

          

# Alpine JS Scroll Amount

Track the users scroll position and their progress on the page 🤿

## Install

### With a CDN

```html

```

### With a Package Manager

```shell
yarn add -D alpinejs-scroll-amount

npm install -D alpinejs-scroll-amount
```

```js
import Alpine from 'alpinejs'
import scrollAmount from 'alpinejs-scroll-amount'

Alpine.plugin(scrollAmount)

Alpine.start()
```

## Example

```html



...


```

This is a basic example of showing a progress bar based on the user scroll.

### Data Returned

```js
return {
scrollPx: 0,
scrollPercent: 0,
atStart: true / false,
atEnd: true / false,
}
```

## Stats

![](https://img.shields.io/bundlephobia/min/alpinejs-scroll-amount)
![](https://img.shields.io/npm/v/alpinejs-scroll-amount)
![](https://img.shields.io/npm/dt/alpinejs-scroll-amount)
![](https://img.shields.io/github/license/markmead/alpinejs-scroll-amount)