Scroll Snap Align
Utilities for controlling the scroll snap alignment of an element.
Use the utility to snap an element to its center when being scrolled inside a snap container.
Scroll in the grid of images to see the expected behaviour
Scroll in the grid of images to see the expected behaviour
Use the utility to snap an element to its end when being scrolled inside a snap container.
Tailwind lets you conditionally apply utility classes in different states using variant modifiers. For example, use hover:snap-start
to only apply the utility on hover.
For a complete list of all available state modifiers, check out the documentation.
You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:snap-start
to apply the utility at only medium screen sizes and above.
To learn more, check out the documentation on , Dark Mode and .