Optionalprops: TModuleProps<Retrieves the module's callbacks instance.
Elements currently registered via addElement.
Indicates whether the instance has been destroyed.
After destruction, destroy is a no-op.
Whether the first observation pass is still active.
Becomes false after the first enter batch is processed, before delayed
in callbacks fire. Prefer tracking initial vs scroll animations yourself
if you rely on staggered maxInitialDelay.
Whether the document uses direction: rtl.
The name of the module, derived from the class name
Optional prefix for classnames used by the module
Current properties. Do not mutate these directly, use updateProps instead.
Protected_addAdds prefixed classes to an element and removes them on destroy.
Skips classes that are already present on the element.
Target DOM element.
Unprefixed class name segments.
Protected_cnBuilds one or more prefixed class names.
Unprefixed class name segments.
Space-separated prefixed class string.
Protected_destroyDisconnects observers and clears the element registry.
Protected_emitEmits a callback event with a fixed payload.
Set default mutable props
Enables or disables the IntersectionObserver instance.
Specifies the root margin offsets for the IntersectionObserver, allowing fine-tuned visibility detection.
Get default static props
Determines whether elements leaving the viewport should trigger an event.
Sets the maximum delay (in milliseconds) for initial element visibility. Delay is calculated based on element position.
Defines the primary scrolling axis used for delay calculations.
Protected_handleMethod that is called when the module's properties mutate. In most cases, used to handle callbacks.
Registers an element for visibility observation.
When data-in-view-class is set, the matching class is toggled on enter/leave.
A function that calls removeElement for this element.
Adds a custom callback to the module.
The event type to listen for (e.g., 'props', 'destroy').
The function to execute when the event is triggered.
Additional settings for the callback.
Registers a function to run when the instance is destroyed.
If the instance is already destroyed, action runs immediately.
Cleanup function (for example remove listeners or DOM classes).
Stops observing an element and clears its in-view flag.
Visibility detection via
IntersectionObserver.maxInitialDelayand element positiondata-in-view-classObservation lifecycle
The first pass uses zero
rootMarginandisInitialStartsemantics. After the first enter batch, observers reconnect withrootMargin.Documentation