Scroll reveal kit

Unfold: content that arrives on cue.

One IntersectionObserver pattern, five entrance styles and zero libraries. Scroll down to see each effect, then copy the attributes at the bottom into any page.

data-revealfade, slide-up, slide-left, slide-right or zoom
data-reveal-delayExtra delay in ms before this element moves
data-reveal-threshold0 to 1: how much must be visible to trigger
data-reveal-staggerOn a parent: children that enter together cascade
Revealed 0 of 0
01 · Fade

Quiet, opacity-only entrances

Best for supporting copy. Nothing moves, so it never distracts. data-reveal="fade"

3.2s

Faster first read

Visitors scan headings before animated blocks catch their eye.

0 kB

No dependencies

A single observer replaces scroll listeners and layout reads.

5

Entrance styles

Fade, three slides and zoom cover most landing-page needs.

02 · Slide up

Lists that rise into place

A short upward travel signals new content without feeling heavy. data-reveal="slide-up"

  • Plan the reading orderHeadings first, then detail
  • Keep travel under 48pxLarge jumps feel janky
  • Animate only transform and opacityBoth run on the compositor
  • Unobserve once revealedLess work while scrolling
03 · Slide left and right

Split layouts that meet in the middle

Opposite directions reinforce a comparison. slide-left slide-right

Before

Scroll listeners

Fires dozens of times per second, forces layout reads with getBoundingClientRect and needs manual throttling.

After

IntersectionObserver

The browser tells you when an element crosses a threshold. No polling, no math, and it pauses off-screen.

04 · Zoom

Gallery tiles that scale in

Great for imagery and product shots. Start at 82% so the growth stays subtle. data-reveal="zoom"

05 · Stagger

A nine-item cascade

Items that enter in the same batch are delayed by their order. Drag the stagger slider and press Replay. data-reveal-stagger

1
2
3
4
5
6
7
8
9
06 · Thresholds

When exactly does it fire?

Scroll slowly. Each box triggers at a different share of its height in view. data-reveal-threshold

0Fires on the first visible pixel
0.5Fires when half is in view
1Fires only when fully in view
07 · Reuse it

The attribute pattern

Add these attributes to any markup. The script on this page reads them and does the rest.

<!-- single element -->
<h2 data-reveal="slide-up">Pricing</h2>

<!-- delayed, fires when half visible -->
<p data-reveal="fade" data-reveal-delay="150" data-reveal-threshold="0.5">...</p>

<!-- staggered group -->
<ul data-reveal-stagger>
  <li data-reveal="zoom">One</li>
  <li data-reveal="zoom">Two</li>
</ul>