Awesome Reveal 1.0: scroll animations for React, Vue and Astro
Awesome Reveal 1.0 is out. It animates elements as they scroll into view: wrap an element in Reveal, and it fades in when it enters the viewport. It now works in React, Vue, Astro and plain JavaScript, and its core has no dependencies.
- New to Awesome Reveal? Try the demos, then add it to your project.
- Coming from
react-awesome-revealv4? Read what changed, then follow the Migrate from v4 guide.
Scroll reveal demos
Section titled “Scroll reveal demos”Pick an entrance. The replay button plays it again, and the tabs show the code for each framework.
Your device asks for reduced motion, so the content shows with no animation. The dashed outline shows where the entrance starts.
import { Reveal } from "@awesome-reveal/react";
export function SectionTitle() { return ( <Reveal from="bottom"> <h2>Hello</h2> </Reveal> );}import { Reveal } from "@awesome-reveal/react";
export function SectionTitle() { return ( <Reveal from="left"> <h2>Hello</h2> </Reveal> );}import { Reveal } from "@awesome-reveal/react";
export function SectionTitle() { return ( <Reveal from={{ opacity: 0, scale: 0.8 }}> <h2>Hello</h2> </Reveal> );}import { Reveal } from "@awesome-reveal/react";
export function SectionTitle() { return ( <Reveal from={{ opacity: 0, blur: 8 }}> <h2>Hello</h2> </Reveal> );}<script setup>import { Reveal } from "@awesome-reveal/vue";</script>
<template> <Reveal from="bottom"> <h2>Hello</h2> </Reveal></template><script setup>import { Reveal } from "@awesome-reveal/vue";</script>
<template> <Reveal from="left"> <h2>Hello</h2> </Reveal></template><script setup>import { Reveal } from "@awesome-reveal/vue";</script>
<template> <Reveal :from="{ opacity: 0, scale: 0.8 }"> <h2>Hello</h2> </Reveal></template><script setup>import { Reveal } from "@awesome-reveal/vue";</script>
<template> <Reveal :from="{ opacity: 0, blur: 8 }"> <h2>Hello</h2> </Reveal></template>---import { Reveal } from "@awesome-reveal/astro";---
<Reveal from="bottom"> <h2>Hello</h2></Reveal>---import { Reveal } from "@awesome-reveal/astro";---
<Reveal from="left"> <h2>Hello</h2></Reveal>---import { Reveal } from "@awesome-reveal/astro";---
<Reveal from={{ opacity: 0, scale: 0.8 }}> <h2>Hello</h2></Reveal>---import { Reveal } from "@awesome-reveal/astro";---
<Reveal from={{ opacity: 0, blur: 8 }}> <h2>Hello</h2></Reveal>import { reveal } from "@awesome-reveal/core";
reveal("h2", { from: "bottom" });import { reveal } from "@awesome-reveal/core";
reveal("h2", { from: "left" });import { reveal } from "@awesome-reveal/core";
reveal("h2", { from: { opacity: 0, scale: 0.8 } });import { reveal } from "@awesome-reveal/core";
reveal("h2", { from: { opacity: 0, blur: 8 } });Cascade reveals its direct children one after another. Pick the interval between two children:
Your device asks for reduced motion, so the content shows with no animation.
import { Cascade } from "@awesome-reveal/react";
export function CardList({ cards }) { return ( <Cascade as="ul" className="cards" interval={0}> {cards.map((card) => ( <li key={card.id}>{card.title}</li> ))} </Cascade> );}import { Cascade } from "@awesome-reveal/react";
export function CardList({ cards }) { return ( <Cascade as="ul" className="cards" interval={80}> {cards.map((card) => ( <li key={card.id}>{card.title}</li> ))} </Cascade> );}import { Cascade } from "@awesome-reveal/react";
export function CardList({ cards }) { return ( <Cascade as="ul" className="cards" interval={160}> {cards.map((card) => ( <li key={card.id}>{card.title}</li> ))} </Cascade> );}<script setup>import { Cascade } from "@awesome-reveal/vue";
defineProps({ cards: { type: Array, required: true } });</script>
<template> <Cascade as="ul" class="cards" :interval="0"> <li v-for="card in cards" :key="card.id">{{ card.title }}</li> </Cascade></template><script setup>import { Cascade } from "@awesome-reveal/vue";
defineProps({ cards: { type: Array, required: true } });</script>
<template> <Cascade as="ul" class="cards" :interval="80"> <li v-for="card in cards" :key="card.id">{{ card.title }}</li> </Cascade></template><script setup>import { Cascade } from "@awesome-reveal/vue";
defineProps({ cards: { type: Array, required: true } });</script>
<template> <Cascade as="ul" class="cards" :interval="160"> <li v-for="card in cards" :key="card.id">{{ card.title }}</li> </Cascade></template>---import { Cascade } from "@awesome-reveal/astro";
interface Props { cards: { id: string; title: string }[];}
const { cards } = Astro.props;---
<Cascade as="ul" class="cards" interval={0}> {cards.map((card) => ( <li>{card.title}</li> ))}</Cascade>---import { Cascade } from "@awesome-reveal/astro";
interface Props { cards: { id: string; title: string }[];}
const { cards } = Astro.props;---
<Cascade as="ul" class="cards" interval={80}> {cards.map((card) => ( <li>{card.title}</li> ))}</Cascade>---import { Cascade } from "@awesome-reveal/astro";
interface Props { cards: { id: string; title: string }[];}
const { cards } = Astro.props;---
<Cascade as="ul" class="cards" interval={160}> {cards.map((card) => ( <li>{card.title}</li> ))}</Cascade>import { cascade } from "@awesome-reveal/core";
cascade("ul.cards", { interval: 0 });import { cascade } from "@awesome-reveal/core";
cascade("ul.cards", { interval: 80 });import { cascade } from "@awesome-reveal/core";
cascade("ul.cards", { interval: 160 });If your system asks for reduced motion, the demos show the content at once, with no animation.
Add scroll animations in React, Vue, Astro or JavaScript
Section titled “Add scroll animations in React, Vue, Astro or JavaScript”Install the package for your framework:
pnpm add @awesome-reveal/reactpnpm add @awesome-reveal/vuepnpm add @awesome-reveal/astropnpm add @awesome-reveal/coreThen wrap an element in Reveal. With @awesome-reveal/core, call reveal() instead.
import { Reveal } from "@awesome-reveal/react";
export function HeroTitle() { return ( <Reveal> <h1>Hello</h1> </Reveal> );}<script setup>import { Reveal } from "@awesome-reveal/vue";</script>
<template> <Reveal> <h1>Hello</h1> </Reveal></template>---import { Reveal } from "@awesome-reveal/astro";---
<Reveal> <h1>Hello</h1></Reveal>import { reveal } from "@awesome-reveal/core";
reveal("h1");When the element enters the viewport, it fades in and moves up 24 pixels. The Get started page covers every step and the requirements. For framework setup, see the Next.js, Vue SSR and Nuxt and Astro pages.
Why Awesome Reveal 1.0 is a rewrite
Section titled “Why Awesome Reveal 1.0 is a rewrite”react-awesome-reveal v4 worked only in React. It built its CSS animations with Emotion and had one component per effect: Fade, Slide, Zoom and more. It already used the Intersection Observer API to find elements that enter the viewport. Today, the Web Animations API can play the entrance too, so the library doesn’t need CSS-in-JS anymore.
So I rewrote it on these two browser APIs:
- One core for every framework. The React, Vue and Astro packages share the same core, so the options and the animations behave the same everywhere.
- A smaller API.
RevealandCascadereplace the effect components, and thefromoption picks the entrance. - No dependencies. The core doesn’t use Emotion or any other package.
The new packages are published as @awesome-reveal/*, and react-awesome-reveal v5 re-exports @awesome-reveal/react.
Why choose Awesome Reveal
Section titled “Why choose Awesome Reveal”A small core with no dependencies
Section titled “A small core with no dependencies”With reveal() and cascade(), @awesome-reveal/core adds less than 2 kB gzipped to your bundle. The measurement doesn’t include the React, Vue and Astro packages. Here’s how I measure the size.
The same API in React, Vue and Astro
Section titled “The same API in React, Vue and Astro”Each framework package has a Reveal and a Cascade, and the JavaScript package has the reveal() and cascade() functions. The entrance and viewport options, such as from, duration and threshold, have the same names and defaults in every package. The Options page shows where each option works. The React API, Vue API, Astro API and JavaScript API pages list the hooks, directives and functions of each one.
Fade, slide, zoom and blur entrances
Section titled “Fade, slide, zoom and blur entrances”The from option sets where the entrance starts. A side, such as "left", fades the element in and moves it 24 pixels. An object gives you a zoom, a rotation or a blur:
import { Reveal } from "@awesome-reveal/react";
<Reveal from="left">Slide in from the left</Reveal>;<Reveal from={{ opacity: 0, scale: 0.8 }}>Zoom in</Reveal>;<Reveal from={{ opacity: 0, blur: 8 }}>Blur in</Reveal>;Need another effect? Pass an array of native keyframes. The Choose the entrance guide has more examples.
Server rendering, accessibility and performance
Section titled “Server rendering, accessibility and performance”- Server rendering. The React, Vue and Astro packages hide the content in the server HTML, so it doesn’t flash before the script runs. If no script attaches the element within 5 seconds, the content shows anyway. See Server rendering without a flash.
- Reduced motion. If the user asks for reduced motion, the content shows at once, with no animation.
- Keyboard focus and print. Content shows when it gets the keyboard focus, and when you print the page. See Accessible scroll animations.
- Smooth animations. No code listens to scroll events, and the default entrances animate only properties that the compositor runs. See Scroll animation performance.
Manual control, agent skills and TypeScript
Section titled “Manual control, agent skills and TypeScript”- Manual control and events. In React, Vue and Astro, the
whenoption reveals an element from your own state, and a reveal event runs your code when the element reveals. See Trigger reveal animations manually and Run code when an element reveals. - Skills for coding agents. Each package includes skills for coding agents, such as Claude Code or Codex. For example, the migration skill tells the agent to replace the v4
cascadeprop withCascade, and to setintervalto the v4duration * damping. See AI coding agent skills and llms.txt. - TypeScript and ES modules. The packages include their own TypeScript types, and they’re ES modules only.
When to choose Awesome Reveal
Section titled “When to choose Awesome Reveal”Awesome Reveal fits landing pages, marketing sites, docs and other content pages that need entrance animations and staggered lists. By default, each entrance plays once, when the element scrolls into view. The when option can play it again. For animations linked to the scroll position, use CSS scroll-driven animations. For exit animations and timelines of many steps, use a general animation library.
What changed from react-awesome-reveal v4
Section titled “What changed from react-awesome-reveal v4”Version 1.0 changes the API on purpose. Here are the main changes for React code:
| react-awesome-reveal v4 | Awesome Reveal 1.0 |
|---|---|
Fade, Slide, Zoom and the other effects |
Reveal, with from or native keyframes |
Emotion keyframes |
Native keyframe objects |
The cascade prop |
The Cascade component |
damping |
interval on Cascade, in milliseconds |
fraction |
threshold |
triggerOnce |
Removed. By default, the entrance plays once. |
onVisibilityChange |
onReveal |
A duration of 1000 milliseconds |
A duration of 600 milliseconds |
reverse |
Removed. Version 1.0 has no exit animations. |
Reveal also renders one element around its children, and one observer watches that element. Version 4 wrapped each element child in a div.
To upgrade, install @awesome-reveal/react, or react-awesome-reveal v5 if you want to keep the old import path. Choose the package compares the two. The Migrate from v4 guide goes through each step, with the v4 position of each effect. The v4 docs stay online.
Get started with Awesome Reveal
Section titled “Get started with Awesome Reveal”Start with the Get started page. It also has a prompt that you can give your coding agent, so it adds the animations for you.
The code is on GitHub, under the MIT license. I’d like to hear what works and what doesn’t, so tell me in GitHub Discussions. To follow the next updates, subscribe to the RSS feed of this blog.