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
In the package npm i hellskitchen-ui Import hkReveal and use it directly.

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; when false it hides again on exit.

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