Skip to content

funkhaus/lenis-scroll-snap

Repository files navigation

📦 Lenis Scroll Snap Plugin

This is a Lenis plugin to mimic scroll-snap css property.

How to use

const lenis = new Lenis({
	direction:'horizontal',
	wrapper: document.getElementById('wrapper'),
	content: document.getElementById('root'),
});

const config = {{snapType: 'mandatory'}}
new ScrollSnap(lenis, config)

Available wrapper attributes

  • scroll-snap-type ( mandatory | proximity ) Default value: mandatory

Available element attributes

  • scroll-snap-align ( start | center | end | none ) Default value: start

Config

  • snapType ( mandatory | proximity ) This config setting overrides scroll-snap-type wrapper attribute value.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published