@tempots/ui

InViewport() function

Creates a renderable component that tracks whether the element is in the viewport.

Signature:

InViewport: (mode: InViewportMode, fn: (value: Signal<boolean>) => TNode) => Renderable

Parameters

Parameter

Type

Description

mode

InViewportMode

The mode for tracking the element's visibility in the viewport.

fn

(value: Signal) => TNode

A function that returns the renderable component based on the visibility signal.

Returns: Renderable

The renderable component that tracks the element's visibility in the viewport.