Skip to content

Bounds

Bindings for @solid-primitives/bounds.

let createElementBounds(
    target: #HTMLElement | Accessor<#HTMLElement>,
    ?trackScroll: bool,
    ?trackMutation: bool,
    ?trackResize: bool
    ): ElementBounds

Returns a reactive, store-like object with the element's position on the screen and its size. All three kinds of tracking are on by default; set the ones you don't need to false.

ParameterListens to
trackScrollWindow scroll events
trackMutationChanges to the DOM structure and styles
trackResizeThe element's resize events

ElementBounds

An interface with width, height, top, left, right and bottom, each an int.

Edit this page