--- name: effects-scroll-snap description: CSS scroll snap for carousels and scroll containers --- # Scroll Snap Utilities for scroll snap behavior in overflow containers. Use for carousels, horizontal galleries, or paged scroll. ## Usage ### Container ```html
Slide 1
Slide 2
Slide 3
Section 1
Section 2
...
``` ### Strictness - `snap-mandatory` - always rest on a snap point - `snap-proximity` - snap only when close to a point (default) ### Child alignment ```html
Center snap
Start snap
End snap
No snap
``` ## Key Points - `snap-x` - horizontal; `snap-y` - vertical; `snap-both` - both; `snap-none` - disable - `snap-mandatory` / `snap-proximity` - strictness - Child: `snap-center`, `snap-start`, `snap-end`, `snap-align-none` - Requires overflow (e.g. `overflow-x-auto`) and scroll on container