Skip to content
New: Customize your theme with an AI assistant. Read the guide

Smooth Scroll

File: src/config/config.toml · Skill level: Beginner

Givo softens mouse-wheel scrolling with Lenis, a small scrolling library. Pages glide a little after each turn of the wheel, and links to a part of the page (such as /donate/#give) scroll there smoothly. The script loads after the page has finished loading, so it does not slow down the first view.

It turns itself off when it would get in the way:

  • On touch-only devices (phones and most tablets), which keep their own scrolling.
  • For visitors who turn on reduce motion in their device settings, while respectReducedMotion is true.

Settings

The settings are in [settings.smoothScroll] in src/config/config.toml:

[settings.smoothScroll]
enable = true
respectReducedMotion = true
duration = 1.1
easing = "expo"
smoothWheel = true
syncTouch = false
wheelMultiplier = 1
touchMultiplier = 1
anchors = true
autoRaf = true
stopInertiaOnNavigate = true
SettingWhat it does
enablefalse keeps the browser’s normal scrolling everywhere
respectReducedMotiontrue turns smooth scrolling off for visitors who ask for reduced motion. Keep it true
durationHow long one scroll takes to settle, in seconds. Higher feels slower and softer
easingThe shape of the slow-down: expo, linear, easeOutQuad, or easeOutCubic
smoothWheelSmooths mouse-wheel and trackpad scrolling
syncTouchSmooths touch scrolling too. Leave it false
wheelMultiplierDistance per wheel step. 1 is normal, 0.8 is shorter
touchMultiplierDistance per swipe, used only with syncTouch
anchorsSmooth scrolling for links to a part of the page
autoRafLets Lenis run its own animation loop. Leave it true
stopInertiaOnNavigateStops the glide when a visitor follows a link

To turn it off, set enable = false. Nothing else changes.

  • [settings.animation] sets the gentle fade-in of sections as they scroll into view. See Animations.
  • stickyHeader in [settings] keeps the header pinned while scrolling. See Header.

For developers: the script is loaded by src/layouts/components/widgets/GlobalScripts.astro and is available as window.__themeLenis once it has started.

Do It With AI

Make smooth scrolling on my Givo site feel [faster / slower / off]. Change only
[settings.smoothScroll] in src/config/config.toml, keep respectReducedMotion = true, and tell me
which values you changed.
Type something to search...