Skip to content

useScrollTo

Package
@maas/vue-equipment/composables
Last Changed
last week

Scroll to element with a set speed

Demo

Top Left
Bottom Right

Usage

ts
import { useScrollTo } from '@maas/vue-equipment/composables'

const { scrollToTarget } = useScrollTo()
const el = ref()

scrollToTarget({
  target: el,
  speed: 1000,
  offset: { x: 0, y: 50 },
})

Released under the MIT License.