eligius
    Preparing search index...

    Variable scrollToElementConst

    scrollToElement: TOperation<
        IScrollToElementOperationData,
        Omit<IScrollToElementOperationData, "behavior" | "block" | "inline">,
    > = ...

    Scrolls the viewport to bring the selected element into view.

    Uses the browser's scrollIntoView API with configurable behavior.

    Operation data with scroll properties erased

    // Smooth scroll to element at top of viewport
    const result = scrollToElement({
    selectedElement: $targetElement,
    behavior: 'smooth',
    block: 'start'
    });
    // Center element in viewport
    const result = scrollToElement({
    selectedElement: $targetElement,
    behavior: 'smooth',
    block: 'center'
    });