3D Card Carousel, animated React component
Product cards standing round a 3D cylinder. Drag or fling it and it coasts, then clicks into place with the nearest card facing you; spin it fast and the cards swing outward and settle back in as it slows, with wheel, arrow keys, dots and a tap on any card also working.
- Free
- Cards
- Scroll
- 3D
- Spring
Ticks each time a new card faces you from your drag, wheel, keys, card tap or dots. Sound is off on this site until you switch it on.
Like 3D Card Carousel? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. 3D Card Carousel stays free.
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| cards | CarouselCard[] | DEFAULT_CARDS | Each { id, name, price, image?, color? }. Without image a phone is drawn in color. |
| radius | number | — | Cylinder radius in px. Defaults to one that fits the cards edge to edge. |
| itemWidth | number | 168 | Card width in px. |
| itemHeight | number | 220 | Card height in px. |
| perspective | number | 1100 | CSS perspective in px. |
| autoRotate | boolean | false | Drift continuously; pauses under the pointer and for a moment after any interaction. |
| autoSpeed | number | 1 | Drift speed multiplier. |
| scrollSpeed | number | 1 | Drag and wheel speed multiplier. |
| direction | "cw" | "ccw" | "cw" | Direction for drift and autoplay. |
| onChange | (index: number) => void | — | Called with the index of the card that settles in front. |
| hint | string | "Drag, scroll or use the arrow keys." | Caption under the dots. An empty string hides it. |
| autoplay | boolean | false | Steps to the next card every 2.4s until someone touches it. |
| className | string | — | Extra classes for the root. |
| enableSound | boolean | true | Plays interface sounds on interaction. They follow the sound switch (setSoundsEnabled, on by default) and stay silent on hover. Autoplay makes the same sounds once the visitor has used the page. Pass false to silence this component. |
Add it to your project
- 1
Set up your project once
You need a Next.js project with Tailwind CSS and the
@/import alias. In its root folder, run this once. It createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry
Run this once per project. It writes the Nexus UI entry into
components.jsonfor you:npx shadcn@latest registry add "@nexus-labs=https://www.nexus-ui.com/api/registry/{name}"Type it exactly as shown.
{name}is filled in by the CLI with the component you ask for, so you never replace it.
- 3
Add the component
Run this from your project root. It adds the component, the helpers it imports and its npm packages.
npx shadcn@latest add @nexus-labs/card-carousel-3d
- 4
Check what was added
With a project made as in the Quick Start (a
src/folder), these files land in it:components/card-carousel-3d/card-carousel-3d.tsxindex.ts - 5
Copying by hand? Skip the registry
Instead of steps 2 and 3 you can copy the files yourself, with no registry and no API key. Step 1 still applies, so that
cn()exists. Install the packages:npm install framer-motion
Then show the source and create each file at the path it gives:
- 6
Use it in a page
Installing only adds the files. Import the component in a page and render it. The Usage tab on the preview shows a fuller example with props:
// src/app/page.tsx import { CardCarousel3D } from "@/components/card-carousel-3d"; export default function Page() { return ( <main> <CardCarousel3D /> </main> ); }
Like 3D Card Carousel? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. 3D Card Carousel stays free.
About 3D Card Carousel
The 3D Card Carousel is a scroll-driven carousel where the active card scales forward while adjacent cards recede in perspective depth. Built with Framer Motion useScroll, useTransform, and spring transitions, the depth effect communicates clearly which item is active without requiring dots or arrows alone. Touch swipe and mouse drag are supported. Ideal for portfolio pieces, testimonial carousels, and product feature showcases that need a spatial, premium feel.
Good for
- Portfolio and work showcase carousels
- Customer testimonial displays
- Product feature story carousels
- Case study and project listings
3D Card Carousel questions
Does it make sound, and how do I turn it off?
Ticks each time a new card faces you from your drag, wheel, keys, card tap or dots. Sounds are synthesised with the Web Audio API, so there are no audio files, and they only play after a click or key press. Pass `enableSound={false}` to silence this component, or call `setSoundsEnabled(false)` from `@/lib/ui-sounds` to switch every sound off at once. The CLI installs `@/lib/ui-sounds` with the component.