Interactivity
Utilities for controlling whether you can skip past possible snap positions.
Class | Styles |
---|---|
snap-normal | scroll-snap-stop: normal; |
snap-always | scroll-snap-stop: always; |
Use the snap-always
utility together with the snap-mandatory utility to force a snap container to always stop on an element before the user can continue scrolling to the next item:
Scroll in the grid of images to see the expected behavior
Use the snap-normal
utility to allow a snap container to skip past possible scroll snap positions:
Scroll in the grid of images to see the expected behavior
Prefix a scroll-snap-stop
utility with a breakpoint variant like md:
to only apply the utility at medium screen sizes and above:
<div class="snap-always md:snap-normal ..."> <!-- ... --></div>
Learn more about using variants in the variants documentation.