Reveal

stable 0.6 kB
<hkReveal>

A scroll-triggered entrance with a stagger. Observes once and then unhooks, so a long page does not carry a hundred live observers.

#directive#scroll

Live demo

Running in this page — interact with it.

Inputs

NameTypeDefaultDescription
revealDelaynumber0Milliseconds before the animation starts. Multiply by index to stagger.
revealThresholdnumber0.15How much must be visible before it fires, 0–1.
revealOncebooleantrueDisconnects after the first reveal.

Theming

Component tokens, each falling back to a global one:

PropertyDefaultControls
--hk-reveal-distance28pxHow far it travels.
--hk-reveal-duration0.8sAnimation length.

Accessibility

  • Under prefers-reduced-motion the element is visible immediately — content is never gated behind an animation.
  • Only opacity, transform and filter are animated, so nothing reflows during the entrance.
  • The observer disconnects after firing, which matters on a page with many revealed blocks.

More in Utility