v0.2 · zero deps · no CSS · ~2 KB

GhostReveal

The modern JavaScript scroll-reveal library

Scroll reveals that feel expensive and weigh nothing

npm i ghost-reveal <div data-reveal>
Scroll

Live demonstration

GhostReveal In Action #

fade

Fades in place. Opacity and blur, with no movement.

fade-up

Rises into place. This is the default.

fade-down

Drops into place from above.

fade-left

Moves left into place.

fade-right

Moves right into place.

zoom-in

Grows from 60% size into place.

zoom-out

Settles in from 120% size.

slide-up

Rises its own height into place.

flip-up

Rotates up into place.

The name is the attribute value. A bare data-reveal is fade-up, and every animation sharpens from a 4px blur.

See the full demonstration

Start in a minute. #

The docs cover the quick start, every option and a guide for each framework. The Playground lets you try all 23 animations live.

The default

Zero config, already premium.

Each item below is just data-reveal, with data-reveal-stagger on the list. The fade rises 16px, goes from a 4px blur to sharp over 700ms on cubic-bezier(.16,1,.3,1), and only touches opacity, transform and filter.

Blur

Focus pull, from none to dreamy.

data-reveal-blur="0" for a crisp fade, or higher for a more cinematic arrival.

blur 0

Crisp

Opacity and travel only.

blur 4 (default)

Subtle

Barely noticed, clearly felt.

blur 12 · 1000ms

Cinematic

For hero moments.

Big moments

Large surfaces stay smooth.

All the work happens on the compositor (transform, opacity, filter). There are no scroll listeners: IntersectionObserver decides when, and the Web Animations API does the rest.

Ghost.

AOS-compatible

Every AOS animation name works.

Keep your data-aos markup. Fade, zoom, slide and flip, each with the same blur-fade polish. Horizontal slides never widen the page.

fade-up
fade-down
fade-left
fade-right
zoom-in
zoom-out
zoom-in-up
flip-up
flip-left
slide-up
slide-left
slide-right

Dynamic content

New nodes reveal themselves.

Ghost Reveal watches the DOM by default with a cheap MutationObserver that only scans added subtrees. That covers framework route changes, infinite lists and CMS embeds.

Experimental · native scroll-driven

Scrubbed with ViewTimeline.

data-reveal-scrub ties progress to scroll position (no JS per frame) where ViewTimeline exists. Other browsers get the normal reveal.

Scroll me

Then scroll back up. It reverses.

zoom-in

The same keyframe data on a scroll timeline.

fade-left

Runs on the compositor in Chromium.

Start

One line.

<script src="https://unpkg.com/ghost-reveal@0.2/dist/ghost-reveal.umd.min.js" data-auto></script>

<h2 data-reveal>Hello</h2>
<img data-reveal="zoom-in" data-reveal-delay="150" src="…" alt="">