Install
Install the library in your Angular project:
npm install elm-ngx-animationsQuick HTML docs for each animation directive, component, and service.
Install the library in your Angular project:
npm install elm-ngx-animationsMinimal setup using standalone components (Angular 16+):
import { Component } from '@angular/core';
import {
FadeInDirective,
SlideInDirective,
ScaleInDirective,
RotateInDirective
} from 'elm-ngx-animations';
@Component({
selector: 'app-animations-demo',
standalone: true,
templateUrl: './animations-demo.component.html',
imports: [
FadeInDirective,
SlideInDirective,
ScaleInDirective,
RotateInDirective
]
})
export class AnimationsDemoComponent {}Use the directives directly in your HTML:
<div ngxFadeIn [duration]="600" [triggerOnScroll]="true">
Fade Animation
</div>
<div ngxSlideIn [direction]="'left'" [duration]="600" [triggerOnScroll]="true">
Slide from Left
</div>Selector:[ngxFadeIn]
Smooth fade in/out animation. Supports scroll‑triggered entrance.
duration (ms, default 600)delay (ms)direction: 'in' | 'out' | 'in-out'triggerOnScroll, threshold<div ngxFadeIn [duration]="500">Content</div>Selector:[ngxSlideIn]
Slides elements from any side with RTL awareness.
direction: 'left' | 'right' | 'top' | 'bottom'distance (px)rtl (force RTL if needed)<div ngxSlideIn direction="left">Slides in</div>Selector:[ngxScaleIn]
Scales elements from a chosen transform origin.
startScale, endScaleorigin: 'center' | 'top-left' | ...<div ngxScaleIn [startScale]="0.5">Scale in</div>Selector:[ngxRotateIn]
3D rotation on X/Y/Z axis.
axis: 'x' | 'y' | 'z'degrees (default 180)<div ngxRotateIn axis="y" [degrees]="90"></div>Bouncy entrance animation for cards.
<div ngxBounceIn direction="up">Bouncy card</div>3D flip card effect (horizontal/vertical/diagonal).
<div ngxFlipIn axis="horizontal">Flip me</div>Utility hover effect (scale + shadow) for cards & buttons.
<div class="card" ngxHoverLift>Hover card</div>Animated number counter for stats and KPIs.
<span ngxCountUp [end]="2500" [duration]="1200"></span>Magnetic hover that pulls toward the cursor.
<button ngxMagnetic [strength]="0.5">Hover me</button>3D tilt card with optional glare overlay.
<div ngxTilt3d [maxTilt]="15" [glare]="true">3D Card</div>Reveal content on scroll with multiple animation presets.
<ngx-scroll-reveal animation="slide-up">...</ngx-scroll-reveal>Stagger animations for lists of items.
<ngx-stagger-list [staggerDelay]="120">...</ngx-stagger-list>Typewriter text, supports Arabic with [rtl].
<ngx-typewriter [text]="'مرحبا بكم'" [rtl]="true"></ngx-typewriter>Continuous scrolling text/content with LTR & RTL modes.
Full‑screen confetti explosion triggered from any action.
Glass profile cards with gradients, stats and Arabic/RTL support.
Layered, scrollable cards that stack on top of each other using ngxParallaxScroll and ngxFadeIn.
Ideal for storytelling, onboarding flows, feature walkthroughs, or case studies where each scroll step reveals the next “chapter” of the story.
Key ideas:
position: sticky card inside a tall container to create stacking.ngxParallaxScroll on a wrapper element for subtle depth and different speeds per card. ngxFadeIn on the content area so cards fade in as they enter the viewport. expanded class on click to reveal more details.<div class="stacked-cards-container">
@for (card of stackedCards; track card.id; let i = $index) {
<div class="stacked-card-wrapper"
ngxParallaxScroll
[speed]="0.15 + i * 0.08">
<article class="stacked-card"
[class.expanded]="expandedId === card.id"
(click)="toggle(card.id)">
<div class="stacked-card-body"
ngxFadeIn
[triggerOnScroll]="true">
<h3>{{ card.title }}</h3>
<p>{{ card.description }}</p>
</div>
</article>
}
}
</div>See the Demo → Scrollable Stacked Cards section for a fully wired example with CTA buttons and expanded detail state.
GSAP‑like API for chaining animations.
const tl = timeline.create().to(el, { opacity: '1' }, 500);Toggle between English/Arabic and LTR/RTL at runtime.
rtl.setLocale('ar'); // RTL + Arabic