Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Scroll Animation

Smooth Scroll

SmoothScroll.vue
Section 1
Section 2
Section 3
Section 4
Section 5
Section 6
Section 7
Section 8
Section 9
Section 10
Section 11
Section 12
Section 13
Section 14
Section 15
Section 16

Install

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/smooth-scroll

Import the shared styles once in your application.

TSUsage
import SmoothScroll from '@/components/beui/layout/SmoothScroll.vue'
import '@/components/beui/styles.css'

API Reference

root?
boolean

Drive the page (window) when true, or a contained scroll area when false.

Defaulttrue
lerp?
number

Smoothing factor; lower is smoother and heavier.

Default.1
duration?
number

Wheel / programmatic ease duration in seconds.

Default1.2
orientation?
"horizontal" | "vertical"
Defaultvertical
wheelMultiplier?
number

Wheel scroll speed multiplier.

Default1
touch?
boolean

Smooth touch scrolling. Off by default — native momentum is good on mobile.

Defaultfalse
class?
string
Default—
#default?
slot
Default—

Updated