- Docs
- Changelog
Changelog
Every @samline/reveal release, newest first, with breaking changes, behavior changes and upgrade steps called out explicitly.
All notable changes to this package. Format: Keep a Changelog; versions follow semver.
[2.0.0] - 2026-12-03
Breaking
reveal()andautoReveal()return aRevealController(elements,show,hide,update,refresh,finished,destroy) instead of a bare cleanup function or{ refresh, destroy }.- The callbacks are named after the events:
onRevealis nowonShowandonRevealedis nowonEnd.onHideis unchanged. There are no aliases. - An unknown, non-empty
data-revealvalue is no longer rewritten to theeffectoption: it is left as is, so your CSS can define the effect (and it fades when you define none). Only an empty or missing value takeseffect. - Without a DOM, or when the observer rejects an option, the call returns a controller whose methods do nothing, instead of a no-op function. With no matching elements it returns a live controller (with no elements), so
refresh()can add matches later; it used to return a no-op.AutoInitControlleris no longer exported.
Added
controller.show(target?)reveals now, even off screen, with the transition and the cascade;controller.hide(target?)hides again instantly and firesonHideandreveal:hide, and elements shown as is (reduced motion, media query not matching) stay visible.hide().show()replays the effect.controller.update(options)merges options and applies them again;controller.refresh()resolves the target again (new matches join, disconnected elements leave). Neither flashes: pending elements stay pending, revealed ones stay revealed and fire no events again. WithautoReveal,update()also applies to elements added later.controller.finished()resolves when no controlled element is queued or revealing, and ondestroy().presetsoption:{ hero: { effect: 'up blur', duration: 900 } }makesdata-reveal="hero"use those per-element options (attributes win, then the preset, then the options of the call). TheRevealPresetandRevealControllertypes.- The
effectoption accepts the name of an effect of your own CSS, keeping autocomplete for the built-in ones. Reveal.show(target?),Reveal.hide(target?)andReveal.refresh()act on the automatic run and are safe before it exists.- Examples: Controls and Presets.
Changed
onHideandreveal:hidealso fire whenhide()hides an element, not only when arepeatelement leaves the viewport.- A callback that throws no longer affects the package: the error is reported with
reportError(or rethrown in a microtask) and the cascade,finished()and the other elements carry on. Callingdestroy(),update(),refresh(),show()orhide()inside a callback or an event listener is safe. show()on an element the observer has not reported yet shows it without a transition.- Size budgets raised to 6600 B (
index.js) and 6700 B (reveal.global.js) gzip for the controller and presets.
Upgrading from 1.x
- Return value:
const stop = reveal('.card')andstop()becomeconst controller = reveal('.card')andcontroller.destroy(). In frameworks,useEffect(() => reveal(ref.current), [])becomesuseEffect(() => reveal(ref.current).destroy, []).autoReveal()still hasrefresh()anddestroy(). - Callback names:
{ onReveal, onRevealed }becomes{ onShow, onEnd }. - Unknown effect values:
<div data-reveal="spin">used to becomedata-reveal="up"(or youreffectoption); now it staysspinand fades unless your CSS defines[data-reveal~='spin']. To keep the old result, writedata-reveal="up"or leave the attribute empty.
[1.2.0] - 2026-12-03
Added
- Cascade patterns on the
data-reveal-staggercontainer:data-reveal-stagger-from(start,end,center,edges,random),data-reveal-stagger-grid(rows and columns measured from the layout),data-reveal-stagger-ease(linear,out) anddata-reveal-stagger-max, with thestaggerFrom,staggerGrid,staggerEaseandstaggerMaxoptions. - Split text:
data-reveal-split="words"or"chars"and thesplitoption animate the text piece by piece with the element’s effect, withdata-reveal-split-stagger,data-reveal-split-max,--reveal-split-staggerand--reveal-index. Screen readers read a visually hidden copy; only plain inline text is split, and anything else inside is revealed as a whole. REVEAL_STAGGER_FROM,REVEAL_STAGGER_EASE,REVEAL_SPLITand their types.- Examples: Stagger and Split text.
Existing markup behaves exactly as before: the new attributes and options are opt-in.
Changed
- Size budgets raised to 5800 B (
index.js) and 5900 B (reveal.global.js) gzip, from 3800 and 3900, for cascade patterns and split text.
[1.1.0] - 2026-12-02
Added
- Effect composition:
data-revealand theeffectoption accept space-separated effects (up blur,zoom fade). One direction and one wipe at most. - Effects
rotate(--reveal-rotate) andwipe-up,wipe-down,wipe-left,wipe-right(clip-path wipes; addfadeto also fade). They work in scrub mode too. - Easing presets
smooth,snappy,springandbouncethroughdata-reveal-easingand theeasingoption, which also accepts any CSS timing function.REVEAL_EASINGS, theRevealEasingtype andReveal.easings. data-reveal-thresholdanddata-reveal-marginoverridethresholdandrootMarginper element.data-reveal-mediaand themediaoption: elements are shown as is while the media query does not match, and pending elements are shown when it stops matching.data-reveal-reduced="fade"and thereducedMotion: 'fade'option: with reduced motion, elements still hide and reveal, but only opacity transitions.- Lifecycle events
reveal:show,reveal:endandreveal:hide(bubbling,detail.animated),EVENT_PREFIX, and theonRevealedoption. - Examples: Compose, Events and Conditions, and rotate and wipes in Effects.
Fixed
- Showing hidden elements when reduced motion turns on now calls
onRevealfor each of them, like every other reveal.
Changed
- Elements with an unknown
data-revealvalue that the script skips (such asdata-reveal-scrubones) no longer slide up by default in CSS: only an empty value orupdoes. - The stylesheet selects effects with
[data-reveal~='…']and keeps each property family independent; the size budgets grew to 3800 and 3900 bytes gzip.
[1.0.4] - 2026-12-02
Changed
- Bundle
@samline/is-visible1.1.2 for visibility-triggered reveals.
[1.0.3] - 2026-11-27
Fixed
- Scrub mode in
style.cssnow also requiresanimation-rangesupport, so browsers that implementanimation-timelinewithoutanimation-rangekeep the element visible instead of scrubbing the whole timeline. The documentedCSS.supportscheck includes it too.
[1.0.2] - 2026-11-17
Fixed
repeatwithstagger: an element revealed on its own after leaving the viewport no longer keeps the cascade delay it got in an earlier batch.
Changed
- Internal: the DOM controller moved from
src/coretosrc/vanilla;src/corekeeps the DOM-free types, constants and helpers. Public entries are unchanged.
[1.0.1] - 2026-11-17
Changed
- The scroll-driven scrub animation in
style.cssis namedreveal-scrubinstead ofsamline-reveal-scrub, like the--reveal-*custom properties. Only CSS that referenced the old keyframes name by hand needs the new one. - The package moved from the
samline/utilsmonorepo to its own repository, samline/reveal. Homepage, repository and documentation links point to the package’s own site.
[1.0.0] - 2026-11-13
Added
- First release:
revealandautoRevealreveal elements as they scroll into view with seven CSS effects (up,down,left,right,fade,zoom,blur), cascades perdata-reveal-staggercontainer,repeat, per-element duration, delay and distance, and a CSS-only scrub mode onanimation-timeline: view(). Content in view on load is never hidden; without JavaScript, with reduced motion or when printing, everything stays visible. ESM, CommonJS,style.cssand a browser global (window.Reveal) that starts on its own.