This is a Lenis plugin to mimic scroll-snap css property.
const lenis = new Lenis({
direction:'horizontal',
wrapper: document.getElementById('wrapper'),
content: document.getElementById('root'),
});
const config = {{snapType: 'mandatory'}}
new ScrollSnap(lenis, config)
scroll-snap-type
( mandatory | proximity ) Default value: mandatory
scroll-snap-align
( start | center | end | none ) Default value: start
snapType
( mandatory | proximity ) This config setting overridesscroll-snap-type
wrapper attribute value.