# vue-is-intersecting

> a vuejs directive to execute a callback when the binding element is intersecting the viewport

Latest version **0.1.6** (published 2021-07-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-is-intersecting
pnpm add vue-is-intersecting
yarn add vue-is-intersecting
bun add vue-is-intersecting
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2021-07-26 |
| First published | 2021-07-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | deafhoog |
| Maintainers | deafhoog |
| Keywords | Vue, Vuejs, IntersectionObserver |

## Links

- npm: https://www.npmjs.com/package/vue-is-intersecting
- Repository: https://github.com/federicopasquarelli/vue-is-intersecting
- Homepage: http://verylazyloading.herokuapp.com/
- Issues: https://github.com/federicopasquarelli/vue-is-intersecting/issues
- npm.io page: https://npm.io/package/vue-is-intersecting

## Recent versions

- 0.1.6 (latest) — 2021-07-26
- 0.1.5 — 2021-07-25
- 0.1.4 — 2021-07-25
- 0.1.3 — 2021-07-24
- 0.1.2 — 2021-07-24
- 0.1.1 — 2021-07-24
- 0.1.0 — 2021-07-24
- 0.0.9 — 2021-07-23
- 0.0.8 — 2021-07-23
- 0.0.7 — 2021-07-23
- 0.0.6 — 2021-07-23
- 0.0.5 — 2021-07-23
- 0.0.4 — 2021-07-23
- 0.0.3 — 2021-07-23
- 0.0.2 — 2021-07-23
- … 1 more at https://npm.io/package/vue-is-intersecting/versions

## README

# Vue Is Intersecting

<a href="https://vuejs.org/"><img src="https://img.shields.io/badge/vue-2.6-brightgreen"/></a>

Vuejs directive to detect when an element appears into the viewport using the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API">intersection observer api</a>

## Demo

<a href="http://verylazyloading.herokuapp.com/">very lazy loading</a>

## Installation

Via npm:

```bash
npm install vue-is-intersecting
```

Via yarn:

```bash
yarn add vue-is-intersecting
```

## Import

```js
import Vue from "vue";
import IsIntersecting from "vue-is-intersecting";

Vue.use(IsIntersecting);
```

## Usage

pass the method that you want to use as a callback when the html element appears in the viewport<br />
NB: by default the callback is debounced after 500ms that the element bind appears in the viewport, to execute the callback immediately use the instant modifier.

```html
<div v-is-intersecting[myData]="myMethod">Hello</div>
```

unique modifier executes the callback only once

```html
<div v-is-intersecting.unique="myMethod">Hello</div>
```

instant modifier executes the callback immediately, no debounce

```html
<div v-is-intersecting.instant="myMethod">Hello</div>
```

current modifier executes two different callbacks when the element appears or disappears in the viewport

```html
<div v-is-intersecting.current="[enterMethod, exitMethod]">Hello</div>
```

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