AOS
An easy-to-use library that makes elements fade, slide, or zoom into view as the user scrolls down your page.
AOS
General JSAn easy-to-use library that makes elements fade, slide, or zoom into view as the user scrolls down your page.
Fit
Bundle (gzip)
4.7 kB
14.1 kB raw
Install size includes transitive dependencies. Bundle size is gzipped browser payload.
Freshness
The Problem
Static websites can often feel flat and unengaging, yet adding professional-grade scroll animations usually requires writing complex, custom scripts that are difficult to maintain. Developing high-quality transitions like fades, slides, or zooms from scratch involves calculating scroll positions and managing CSS classes manually, which is a significant hurdle when you simply want your interface to feel more interactive without the technical headache.
What It Does
AOS simplifies the animation process by handling the heavy lifting of scroll detection and CSS triggering for you. It solves the problem of complex scripting by allowing you to apply sophisticated entrance effects directly to your HTML elements via simple data attributes. Instead of writing custom JavaScript to track every movement, the library automatically animates your content as it enters the viewport, instantly transforming a static page into a dynamic, interactive experience with zero manual animation logic required.
Installation
npm i aosUsage Example
Import the library to your page :
import "aos/dist/aos.css";
import AOS from "aos";Or import directly to your HTML page :
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet" />
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>Initialize the library :
AOS.init();Add the property to element(s) you want to animate :
<div data-aos="fade-up"></div>Related packages
Unified TypeScript SDK for building AI-powered apps — switch between 20+ LLM providers without rewriting code.
animejsGeneral JSLightweight JavaScript animation library with a tiny footprint and a powerful, expressive API.
archiverGeneral JSStreaming interface for generating ZIP and TAR archives in Node.js — create compressed archives programmatically from files, directories, and buffers.
@formkit/auto-animateGeneral JS> Add smooth transitions to any element with a single line — zero-config animations for adds, removes, and moves.
axiosGeneral JSPromise-based HTTP client for the browser and Node.js — interceptors, automatic JSON parsing, request cancellation, and progress events.