IParallaxLayerProvide

interface
Parallax

Provide context exposed by the enriched OrigamParallax to its `<OrigamParallaxLayer>` children. Distinct from the legacy `IParallaxProvide` consumed by `<OrigamParallaxElement>` (kept separate to avoid coupling the two APIs).

TypeScript

Definition

The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.

typescript

API

Properties

Every property declared by this interface, with its type, optionality and default.

direction
required
Ref<TParallaxDirection>
easing
required
Ref<TParallaxEasing | string>
disabled
required
Ref<boolean>
progress
required
Ref<number>
Live scroll progress, normalised to `[0, 1]`. `0` = host just entered the viewport, `1` = host just left.
mouseRatio
required
Ref<{ x: number, y: number }>
Live mouse-ratio for `direction="both"` on `event="move"` — `{ x: 0..1, y: 0..1 }`. Falls back to `{ x: 0.5, y: 0.5 }` when no mouse data is available.
cssScrollDriven
required
Ref<boolean>
Whether the runtime is using the CSS scroll-driven path (true) or the JS rAF fallback (false). Layers may opt out of the JS work when the CSS path is active.
reducedMotion
required
Ref<boolean>
Whether `prefers-reduced-motion: reduce` is honoured — layers MUST stay at offset 0 when this is true.
register
required
(layer: IParallaxLayerRegistry) => void
Register / unregister a layer with the parent. The parent reads the registry to compute and apply per-layer transforms each frame.
unregister
required
(id: symbol) => void
update
required
(id: symbol, patch: Pick<IParallaxLayerRegistry, 'speed' | 'offsetX' | 'offsetY'>) => void