# view-in

> A dependency free utility to set and remove animation classes on elements as they become visible in the viewport, using the Intersection Observer API

Latest version **0.0.4** (published 2017-12-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install view-in
pnpm add view-in
yarn add view-in
bun add view-in
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2017-12-18 |
| First published | 2017-12-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Ryan Hyslop |
| Maintainers | ryanhyslop |
| Keywords | Animation, inview, intersection, observer |

## Links

- npm: https://www.npmjs.com/package/view-in
- Repository: https://github.com/uvd/viewIn
- Homepage: https://github.com/uvd/viewIn#readme
- Issues: https://github.com/uvd/viewIn/issues
- npm.io page: https://npm.io/package/view-in

## Alternatives

- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K weekly downloads
- [persona-harness](https://npm.io/package/persona-harness.md) — 4.7K weekly downloads
- [@tsparticles/effect-bubble](https://npm.io/package/@tsparticles/effect-bubble.md) — 4.6K weekly downloads
- [f3d](https://npm.io/package/f3d.md) — 730 weekly downloads
- [spark-html-motion](https://npm.io/package/spark-html-motion.md) — 298 weekly downloads

## Recent versions

- 0.0.4 (latest) — 2017-12-18
- 0.0.2 — 2017-12-11
- 0.0.1 — 2017-12-07

## README

# ViewIn.js

ViewIn(tersector) is a simple utility to apply and remove classes to DOM elements as they enter the view port, using the Intersection Observer API.

## Usage

`viewIn('.my-selector', options);`

## Options

| Option         | Type   | Default      | Description                                     |
| :------------- | :----- | :----------- | :---------------------------------------------- |
| classOnEnter   | string | inview-enter | Class added when element is visible             |
| classOnExit    | string | inview-exit  | Class added was visible but then exits viewport |
| exitThreshold  | number | 0.75         | % of element visible to trigger exit            |
| enterThreshold | number | 0.75         | % of element visible to trigger enter           |

## To Do

* Add Interes feature detection
* Allow a callback to be passed for exit and enter
* Make options ... optional
* Error cases
* `once: boolean` - only trigger the observerable once

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