Card Stack Rotator, animated React component
A stack of testimonial cards: flick the top card away and it flies out, drops behind the pile and slides home into the back slot with a wobble. The next card rises and its **highlighted** words get a fresh highlighter stroke. Also includes Rolodex Testimonials, quotes on a 3D rolodex drum that clicks to the next one, spins when dragged, coasts when flicked and always lands square on a card.
- Free
- Testimonials
- Spring
Swishes when you flick a card away or press an arrow key; the rolodex ticks each time a new quote comes square. Sound is off on this site until you switch it on.
Card Stack Rotator
Rolodex Testimonials
Like Card Stack Rotator? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Card Stack Rotator stays free.
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
We shipped the new onboarding in three days. The stack alone got more replies than the launch email.
Flick the top card away.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| cards | CardData[] | — | Cards, front first: { id, content, name, designation, company?, initials?, avatarUrl? }. Wrap words in **double asterisks** to highlight them. |
| rotationInterval | number | 0 | Throw the front card to the back every this many ms, paused on hover. 0 turns it off. |
| maxVisible | number | 3 | How many cards are drawn in the stack. |
| stackOffset | number | 14 | How far each card behind peeks out below, in px. |
| scaleStep | number | 0.05 | How much smaller each card behind is. |
| cardWidth | string | "420px" | CSS width of the stack; it never grows past its container. |
| cardHeight | string | "auto" | CSS height of each card. auto sizes to the tallest card. |
| direction | "forward" | "backward" | "forward" | Which way cards are thrown: forward flicks left, backward flicks right. |
| hint | string | "Flick the top card away." | Hint under the stack. An empty string hides it. |
| onChange | (id: string) => void | — | Called with the id of the card that comes to the front. |
| autoplay | boolean | false | Flicks the top card away every 2.6s until someone touches the stack. |
| cardBackground / textColor / mutedColor | string | — | Optional colour overrides; by default the cards follow light and dark mode. |
| highlightBackground / highlightTextColor | string | — | Optional colours for the highlighter stroke and highlighted words. |
| pauseOnHover | boolean | true | Pause rotationInterval while the pointer is over the stack. |
| className | string | — | Extra classes for the root. |
| RolodexTestimonials.cards | RolodexCard[] | ten demo quotes | The testimonials in drum order. Each has a quote, a name, a role and a two-colour hue for the avatar. |
| RolodexTestimonials.autoplay | boolean | false | Clicks the drum round to the next quote every 2.6 seconds until someone touches it. Pauses off screen and never runs under reduced motion. |
| RolodexTestimonials.onChange | (index: number) => void | undefined | Called with the index of the card that comes square to the front. |
| RolodexTestimonials.className | string | undefined | Extra classes for the root, which is 380px wide at most. |
| 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-stack-rotator
- 4
Check what was added
With a project made as in the Quick Start (a
src/folder), these files land in it:components/card-stack-rotator/card-stack-rotator.tsxindex.tsrolodex-testimonials.tsx - 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 { CardStackRotator } from "@/components/card-stack-rotator"; export default function Page() { return ( <main> <CardStackRotator /> </main> ); }
Like Card Stack Rotator? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Card Stack Rotator stays free.
About Card Stack Rotator
The Card Stack Rotator is a premium testimonial and content carousel where cards sit in a 3D stack perspective and rotate to the front with spring animations. Cards in the back stack are visible at reduced scale, communicating that more content is available. Auto-rotation advances through cards at a configurable interval and pauses on hover. Inline bold highlight text within cards uses a distinctive styled span for visual emphasis on key phrases.
Good for
- Customer testimonial sections
- Feature story carousels
- Case study preview rotators
- Product benefit highlight stacks
Card Stack Rotator questions
How do I highlight words in a quote?
Wrap the words in double asterisks, like `**absolutely incredible**`, inside a card's `content`. They render as a highlighted mark.
How do I change the rotation speed?
Set `rotationInterval` in milliseconds (default 3000). `pauseOnHover` is on by default, and `maxVisible`, `stackOffset` and `scaleStep` shape the stack.
What does each card need?
Each card takes `id`, `content`, `name` and `designation`, plus optional `avatarUrl`, `initials` and `company`. Without an avatar, initials are generated from the name.
How do I add it to my project?
Copy the component source from this page into your project and install framer-motion. Auto-rotation stops for users who prefer reduced motion.
Does it make sound, and how do I turn it off?
Swishes when you flick a card away or press an arrow key; the rolodex ticks each time a new quote comes square. 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.