Skip to content

Hero sequence

The title, the lead and the buttons of a hero enter one after the other. Each part has its own Reveal, and each delay is larger than the previous one.

Build pages that feel alive

Reveal animations for React, Vue, Astro and plain JavaScript.

Get startedRead the docs

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

Effect
Gap
Fine-tune
600ms
0ms
Hero.jsx
import { Reveal } from "@awesome-reveal/react";
import { slide } from "@awesome-reveal/react/keyframes";
export function Hero({ title, lead }) {
return (
<header className="hero">
<Reveal as="h1" keyframes={slide()}>{title}</Reveal>
<Reveal as="p" keyframes={slide()} delay={200}>{lead}</Reveal>
<Reveal className="actions" keyframes={slide()} stagger={80} delay={400}>
<a href="/start">Get started</a>
<a href="/docs">Read the docs</a>
</Reveal>
</header>
);
}
styles.css
/* Transforms do not apply to inline elements. */
.actions {
display: flex;
gap: 0.5rem;
}

One Reveal with stagger on the whole hero would animate the buttons as one element. With a Reveal for each part, the buttons get their own stagger, and each part can have its own keyframes.

  • The delays work because the parts enter the viewport together. Above the fold, they enter when the page loads. A Reveal that enters later starts its delay at that time.
  • Keep the sequence short. The last part starts two gaps after the first one, so a long gap makes visitors wait for the buttons.
  • The title is often the Largest Contentful Paint (LCP) element. Chrome skips elements at opacity 0 when it measures LCP, so a hidden title can delay LCP. If the title is your LCP element, keep it out of the sequence.