Skip to content
All effects

Snap carousel with arrows

A row of cards that scrolls natively and snaps into place, with arrows that know when you reach the end.

Layout

This is the real effect. Scroll or move your mouse inside the frame to try it.

The prompt

Turn [the cards I point to] into a snap carousel with arrows: a row that scrolls natively and snaps into place, with arrow buttons for desktop. Tech: no slider library. The track is a horizontal scroll container with scroll-snap-type: x mandatory, each card has scroll-snap-align: start, and the scrollbar is hidden. On mobile, let the next card peek in so people know they can swipe. Touch and trackpad scrolling just work. Arrows: two buttons next to the heading. One click scrolls by exactly one card width plus the gap, with smooth scrolling. The arrows are disabled at the start and the end (check the scroll position on scroll and on resize; settle the state on scrollend where supported, with a fallback for browsers without it). Optional: small dots under the track that show the current position. Accessibility: the cards are a list, the track can be focused and scrolled with the arrow keys, the buttons have labels and a visible disabled state. Respect prefers-reduced-motion by scrolling instantly. Style: build it in the existing design system of this website. Reuse its colours, fonts, spacing, corner radius and existing classes or components, and don't add new colours or fonts. Use real content from this website for any text or images in the effect (its headings, services and copy), never placeholder text. If the project has no design system yet, ask me for the brand colours and fonts before you start.

What it is

A row of cards you can swipe through, that always snaps neatly into place. On desktop two arrows do the same, and they grey out when you reach the end.

When it works

Blog posts, products, reviews, anything where a row is better than a long list. The blog carousel on Living with Prompts works like this. It is the most boring effect in this library, and also the one you will use most.

Get it right

  • Use native scroll snap. A slider library adds weight and breaks touch scrolling.
  • Let the next card peek in on mobile, so people know they can swipe.
  • Disable the arrows at the ends.

Also called

  • Scroll snap slider
  • Native carousel
  • Card slider with arrows
  • CSS scroll snap carousel

More effects.

All effects