Stack Rolodex
A rotating vertical pill stack that cycles through a list rolodex-style, with depth scaling, edge fading, and an optional side label.
Props
Installation
Stack Rolodex is published as a shadcn registry item. The CLI drops the file into your project, installs its dependencies, and adds any primitives it relies on.
$npx shadcn@latest add @akoder/stack-rolodexThe @akoder namespace ships with the shadcn CLI, so there is nothing to configure first. Install any other component the same way from the components page.
Usage
The only required prop is items. Each item needs an id, a name, and an
icon, which is any component that accepts a className: react-icons,
lucide-react, or your own SVG components all work.
Label
label renders a static line beside the stack. Omit it to render the stack on
its own.
Brand colors
An item can carry its brand color. When that item reaches the active slot,
its icon takes the color, settled with a CSS transition in step with the
motion. The pill itself keeps the same neutral styling in every slot.
Items without a color keep the default neutral styling, which suits
monochrome brands like Vercel or GitHub.
Timing and depth
interval sets the milliseconds between rotations and step the vertical
distance between neighbouring pills in pixels. Three pills stay visible on
each side of the active one; anything further out fades to nothing, and the
stack itself dissolves at both ends through a mask.
Props
StackRolodex
| Prop | Type | Default | Notes |
|---|---|---|---|
items | StackRolodexItem[] | required | Pills to cycle through. Needs at least two items to rotate. |
label | string | - | Static line rendered beside the stack. Omit to render the stack alone. |
interval | number | 2000 | Milliseconds between rotations. |
step | number | 50 | Vertical distance between neighbouring pills, in pixels. |
className | string | - | Extra classes for the root. |
StackRolodexItem
| Prop | Type | Default | Notes |
|---|---|---|---|
id | string | required | Stable key for the pill. |
name | string | required | Text inside the pill. |
icon | ComponentType<{ className?: string }> | required | Any icon component, sized by the pill. |
color | string | - | Brand color the icon takes while the pill is active. |
Notes & features
- Continuous wraparound. The active index grows forever and each pill's offset wraps into a centred window, so the rotation never hits an edge or snaps back to the start. Pills that cross the wrap point teleport with a zero-duration transition instead of sweeping across the stack.
- Depth by distance. Pills shrink and fade the further they sit from the active slot, and the stack is masked at both ends so the top and bottom pills dissolve instead of clipping.
- Brand colors on the active pill. An optional per-item
colortints the active pill's icon while the pill keeps its neutral styling. The color change rides a CSS transition, so onlytransformandopacityrun through Motion. - Reduced motion. When the operating system asks for reduced motion, the transitions collapse to zero duration. The rotation still steps, it just stops animating.
- Any icon set. Items take icon components rather than image URLs, so brand icons from react-icons, glyphs from lucide-react, or hand-drawn SVG components all drop in.
Manual installation
Rather not use the CLI? Everything Stack Rolodex needs is below. Install its dependencies, then copy the file into the matching path in your project.
Dependencies
$npm install motionSource