0.2.0

The scroll API provides smooth scroll-to-target functionality. Access it through instance.scroll.

Properties

PropertyTypeDescription
isScrollingbooleanWhether a scroll animation is currently in progress
isLockedbooleanWhether manual page scroll is currently blocked

Methods

MethodDescription
scrollTo(element)Scroll to bring an element into view. Resolves when animation finishes.

Usage

// Scroll to a specific element
await instance.scroll.scrollTo(document.getElementById('target'));

// Check if scrolling
if (instance.scroll.isScrolling) {
  console.log('Scroll animation in progress');
}

When scroll: false is set in config, scrollTo becomes a no-op that resolves immediately.

When animation.isEnabled is false globally, scroll still runs but becomes an instant jump regardless of the configured duration.