Interface ScrollToTopConfig

interface ScrollToTopConfig {
    offset?:
        | `left: ${string}`
        | `top: ${string}`
        | `bottom: ${string}`
        | `right: ${string}`;
    position?: "left"
    | "right";
}

Properties

Properties

offset?:
    | `left: ${string}`
    | `top: ${string}`
    | `bottom: ${string}`
    | `right: ${string}`

The button will be shown when the scroll top offset of the page is below the given value, and hidden otherwise. Accepts a colon-separated key:value string where the key is "top" or "bottom" (or if your page scrolls horizontally, then use "left" or "right"), and the value can be any valid CSS length specification, e.g. "top: 200vh" or "top: var(--offset, 50%)".

Alternatively, you set the --lisn-scroll-to-top--offset CSS variable on the document root, which is used by the default value.

"top: var(--lisn-scroll-to-top--offset, 200vh)"
position?: "left" | "right"

The horizontal position of the scroll-to-top button.

"right"