Skip to content

Alternating sections

Each section slides in from the side opposite to the previous one. Each section has its own Reveal, so it animates when it enters the viewport.

PlanPick an effect for each part of the page.
BuildWrap each part in a Reveal.
ShipEach part animates when it scrolls into view.

Your system reduces motion, so the preview does not animate. The code still follows your choices.

Distance
Easing
Fine-tune
800ms
0ms
Stories.jsx
import { Reveal } from "@awesome-reveal/react";
import { slide } from "@awesome-reveal/react/keyframes";
export function Stories({ stories }) {
return stories.map((story, index) => (
<Reveal
key={story.title}
as="section"
className="story"
keyframes={slide({ direction: index % 2 ? "left" : "right", distance: 64 })}
duration={800}
>
<h2>{story.title}</h2>
<p>{story.text}</p>
</Reveal>
));
}