Skip to content

InView ​

0.3.0 ​

2026-09-26

  • createRevealController's stagger delay now skips itself entirely under prefers-reduced-motion: reduce — the class/attribute toggle still happens normally, only the staggered timing is skipped.
  • createElementTracker (and the useElementViewport/useParallaxLayer composables/hooks built on it, Vue and React) accepts a root element to measure viewportProgress/distanceFromCenter against a scrollable container instead of the window — for a parallax layer or viewport tracker living inside overflow: auto (a dashboard panel, a modal). The returned rect itself stays window-relative either way.
  • useElementVisibility's options are now reactive in both adapters. Vue: threshold/rootMargin/root/once accept a ref/getter — threshold/rootMargin/root changing re-subscribes for real, once updates live without tearing down the subscription. React:once/onEnter/onLeave now update live across re-renders (previously frozen at the render that first created the subscription), and a fresh inline threshold array literal every render no longer forces a needless re-subscribe.
  • New Vue composables: useRevealController (creates createRevealController on mount, destroys it on unmount), usePrefersReducedMotion (a reactive Ref<boolean>, unlike the static prefersReducedMotion()), useStagger, useScrollTo, useScrollSpy.
  • New React hooks: useReveal (the equivalent of Vue's v-reveal — toggles a class/attribute automatically), useRevealController, usePrefersReducedMotion, useStagger, useScrollTo, useScrollSpy — same shape as the Vue composables above.
  • New in @macrulez/inview-core: createScrollSpy (tracks which of a list of targets sits in an "active" band near the viewport's vertical center, for nav-highlight UIs) and scrollToElement (smooth-scrolls a target so an element lands at its edge, with a px offset).
  • createRevealController's returned controller gained observe(el)/ unobserve(el) (for elements outside the selector scan) and refresh(selector?) (a one-off scan with a different selector, on top of the existing no-argument refresh()). Per-element data-reveal-attribute now overrides activeAttribute for one element, the same way data-reveal-class already did for activeClass.
  • Nuxt's auto-import list now includes useRevealController, usePrefersReducedMotion, useStagger, useScrollTo, useScrollSpy, createScrollSpy, and scrollToElement.