InView
0.3.0
2026-09-26
createRevealController's stagger delay now skips itself entirely underprefers-reduced-motion: reduce— the class/attribute toggle still happens normally, only the staggered timing is skipped.createElementTracker(and theuseElementViewport/useParallaxLayercomposables/hooks built on it, Vue and React) accepts arootelement to measureviewportProgress/distanceFromCenteragainst a scrollable container instead of the window — for a parallax layer or viewport tracker living insideoverflow: auto(a dashboard panel, a modal). The returnedrectitself stays window-relative either way.useElementVisibility's options are now reactive in both adapters. Vue:threshold/rootMargin/root/onceaccept a ref/getter —threshold/rootMargin/rootchanging re-subscribes for real,onceupdates live without tearing down the subscription. React:once/onEnter/onLeavenow update live across re-renders (previously frozen at the render that first created the subscription), and a fresh inlinethresholdarray literal every render no longer forces a needless re-subscribe.- New Vue composables:
useRevealController(createscreateRevealControlleron mount, destroys it on unmount),usePrefersReducedMotion(a reactiveRef<boolean>, unlike the staticprefersReducedMotion()),useStagger,useScrollTo,useScrollSpy. - New React hooks:
useReveal(the equivalent of Vue'sv-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) andscrollToElement(smooth-scrolls a target so an element lands at its edge, with a px offset). createRevealController's returned controller gainedobserve(el)/unobserve(el)(for elements outside theselectorscan) andrefresh(selector?)(a one-off scan with a different selector, on top of the existing no-argumentrefresh()). Per-elementdata-reveal-attributenow overridesactiveAttributefor one element, the same waydata-reveal-classalready did foractiveClass.- Nuxt's auto-import list now includes
useRevealController,usePrefersReducedMotion,useStagger,useScrollTo,useScrollSpy,createScrollSpy, andscrollToElement.