Skip to main content
Angular Animations

Animations Overview

Estimated Time: 2 hours | Difficulty: Intermediate | Prerequisites: Components, Templates
Angular’s animation system is built on the Web Animations API, providing a powerful DSL (Domain-Specific Language) for creating complex, performant animations. Unlike CSS animations, Angular animations are state-aware — they know about your component’s data, can react to route changes, and can coordinate across multiple elements. Think of CSS animations as a record player (plays the same thing every time) versus Angular animations as a live DJ (responds to what is happening in real-time). When to use Angular animations vs CSS: Use CSS for simple hover effects, loading spinners, or animations that do not depend on component state. Use Angular animations when the animation needs to react to data changes, coordinate enter/leave transitions, stagger list items, or synchronize with route navigation.

Setup

Common gotcha: If you forget to provide either provideAnimations() or provideAnimationsAsync(), your [@trigger] bindings will silently do nothing. No error, no animation — just a confusing lack of movement. This is the single most common “why isn’t my animation working?” issue.

Basic Animations

State-Based Animation

Enter/Leave Animations


Advanced Animations

Staggered List Animation

Staggering creates a “cascade” effect where each item animates with a slight delay after the previous one. This is the animation pattern that makes list UIs feel polished — think of how iOS notification center items slide in one after another rather than all at once. The key is stagger(), which adds an incremental delay to each :enter or :leave element matched by query().

Page Transition Animation

Complex Multi-Step Animation


Reusable Animation Functions


Animation Callbacks


Performance Tips

Use transform & opacity

Animate only transform and opacity for 60fps - they’re GPU accelerated

will-change Hint

Use will-change: transform for complex animations

Disable When Not Visible

Use @.disabled binding to disable animations conditionally

Lazy Load Animations

Use provideAnimationsAsync() to lazy-load animation code

Next: Internationalization (i18n)

Add multi-language support to your Angular applications