ThatDesignUIOriginalInteractive preview
Story carousel
A centred snap carousel with receding side cards, previous and next buttons, dots and a counter, built to the W3C carousel pattern. Drag, swipe or use the keyboard.
- Category
- Sliders
- Platform
- Responsive
- Colorful
- Interactive
- Touch friendly
Interactive componentClick through it, resize it, or switch states. It’s real UI, not a screenshot.
Use this component
Free to use. It works on its own in any React and Tailwind project, so you can add it with one command, paste the code, or hand the prompt to your coding agent.
FreeReact 18+Tailwind v3.4 or v4No extra packages
1. Add it with the shadcn CLI
npx shadcn@latest add https://www.thatdesignui.com/r/snap-carousel.json2. Use it
Every prop is optionalapp/page.tsx
import SnapCarousel from "@/components/snap-carousel";
export default function Page() {
return <SnapCarousel />;
}Prefer to paste it yourself? Open the .
Under the hood
How it’s built
What’s inside
- A header with an eyebrow, a title, a two-digit counter (02 / 05) and round previous and next buttons.
- A horizontally scrolling rail of 4:5 gradient cards (max 24rem wide) that snap to the centre. Side cards shrink and fade; the rail edges fade out.
- Each card has an index, a floating glass illustration, a tag pill, a title and a sentence over a gradient scrim.
- Dots under the rail show the position (the current dot is a long pill). No auto-rotation.
- The region and each slide carry aria-roledescription (carousel and slide) with accessible names like '2 of 5: Title'.
How it behaves
- Next and Previous buttons scroll one card and disable at the ends; the counter and dots update.
- Dragging with a mouse, swiping on touch and scrolling with a trackpad all work and snap to a card.
- With the rail focused, Left/Right/Home/End move between cards.
- The first card is centred on load at 375px, 768px and desktop widths.
- Reaching the end of the rail marks the last dot current even when several cards are visible.



