Skip to content

anotherempty/svelte-intersection-api-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Svelte Intersection Observer Action

Easily integrate the Intersection Observer API in Svelte

See the demo

Installation

npm install svelte-intersection-api-action

Usage

<script>
  import { intersectionAPI } from "svelte-intersection-api-action";

</script>

<div use:intersectionAPI={{ options }} on:crossed={(e)=>doSomething(e.detail)}>
</div>

Props

options : The options used by the Intersection Observer API

e.detail : An IntersectionObserverEntry, is dispatched when a threshold is crossed

License

Distributed under the MIT License.

Releases

No releases published

Packages

No packages published