You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP β†’
Socket
Book a DemoInstallSign in
Socket

ngx-element-in-view

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-element-in-view

> πŸ” Angular directive to detect when an element enters the viewport using `IntersectionObserver`. Add animation classes or trigger callbacks with ease.

0.0.6
latest
npmnpm
Version published
Weekly downloads
30
-85.29%
Maintainers
1
Weekly downloads
Β 
Created
Source

ngx-in-view

πŸ” Angular directive to detect when an element enters the viewport using IntersectionObserver. Add animation classes or trigger callbacks with ease.

npm downloads license

✨ Features

  • πŸ” Automatically detect when an element comes into view
  • 🎨 Add CSS animation classes
  • πŸ”” Trigger callbacks via (inView) event
  • βš™οΈ Configurable threshold and trigger behavior
  • 🧩 Works great with lazy-loading and animation libraries like Animate.css or GSAP

πŸ“¦ Installation

npm install ngx-in-view

## 🧰 Parameters

| Parameter         | Type                    | Default  | Description                                                                 |
|-------------------|-------------------------|----------|-----------------------------------------------------------------------------|
| `ngxElementInView`       | `string`                | `''`     | (Optional) Space-separated CSS classes to apply when element is in view     |
| `threshold`       | `number`                | `0.1`    | (Optional) Visibility ratio (0 to 1) required to trigger the directive       |
| `triggerOnce`     | `boolean`               | `true`   | (Optional) If true, the directive triggers only once                        |
| `visibilityBeforeInView`     | `boolean`               | `true`   | (Optional) If false, the element will display only once in view                       |
| `(inView)`        | `EventEmitter<void>`    | β€”        | Emits when the element becomes visible in the viewport                      |


## Example

<div
  [ngxElementInView]="'fade-in bounce'"
  [threshold]="0.3"
  [triggerOnce]="true"
>
  This will animate when it appears in the viewport!
</div>

Keywords

angular

FAQs

Package last updated on 14 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts