Skip to content

Get started with scroll animations

Awesome Reveal animates elements when they scroll into view. Each framework package uses the same core. The core uses the Intersection Observer API and the Web Animations API of the browser, and it has no dependencies.

Framework Framework version Node.js
React 18 or 19 20.19 or later
Vue 3.5 or later 20.19 or later
Astro 6 or 7 22.12 or later
JavaScript 20.19 or later

The packages are ES modules only. They include their TypeScript types.

Install the package for your framework.

Terminal window
pnpm add @awesome-reveal/react

With npm, yarn or bun, use npm install, yarn add or bun add, followed by the package name.

Wrap the element in Reveal. With @awesome-reveal/core, call reveal() with a CSS selector, an element or a list of elements.

import { Reveal } from "@awesome-reveal/react";
export function HeroTitle() {
return (
<Reveal>
<h1>Hello</h1>
</Reveal>
);
}

When the element enters the viewport, it fades in and moves up 24 pixels. The entrance plays one time. You do not import a stylesheet.

Cascade reveals its direct children one after the other. The interval option sets the time between the start of two children, in milliseconds. The default is 80.

import { Cascade } from "@awesome-reveal/react";
export function FeatureList() {
return (
<Cascade as="ul" interval={120}>
<li>Small</li>
<li>Native</li>
<li>Accessible</li>
</Cascade>
);
}