motion-reveal

Animates its content in when it enters the viewport. Uses IntersectionObserver with spring-based fade and lift.

Preview

Scroll to reveal

Import

import 'motion-components/motion-reveal'   // just this one
import 'motion-components'               // or the whole library

Usage

<motion-reveal duration="0.6" y="24">
  <h2>Fades into view</h2>
</motion-reveal>

Sequence with delay

Give each reveal a different delay to bring a block in one piece after another.

Motion that feels alive

Spring-based components for the web.

Get started
<motion-reveal>
  <h2>Motion that feels alive</h2>
</motion-reveal>
<motion-reveal delay="0.15">
  <p>Spring-based components for the web.</p>
</motion-reveal>
<motion-reveal delay="0.3">
  <a href="/docs">Get started</a>
</motion-reveal>

Properties

Attribute Property Type Default Description
duration duration number 0.6 Spring duration hint in seconds
delay delay number 0 Seconds to wait before the reveal starts. Set different values on several reveals to bring them in one after another
y y number 24 Initial vertical offset in px
threshold threshold number 0.1 IntersectionObserver visibility threshold (0–1)
once once boolean true Animate only on first intersection. Set it to "false" to replay on every entry

JavaScript API

Trigger the reveal programmatically with play(), cancel(), and replay().

Reveal from JavaScript
–

Accessibility

Respects prefers-reduced-motion: when enabled, the reveal animation is skipped and content appears immediately at its final state.