Editorial Image Stack
A radial pinwheel of N square cards stacked on the same center point, each rotated by its own increment so only the corners stick out around a stable center card. Colors hand off to their neighbor on every smooth step.
Installation#
pnpm dlx shadcn@latest add @davinciui/editorial-image-stackUsage#
Every ring card is the same size as the center card and stacked at the same center point (position: absolute; inset: 0), each rotated by i * steparound its own center. Only the corners and edges that extend beyond the front card are visible, forming a circular pinwheel silhouette. The whole ring is driven by a single requestAnimationFrameloop: one wrapper element is rotated by the accumulated angle (one step every interval), while each card keeps its static offset — so only one transform is animated per tick. Drift continues slowly between steps and stops under prefers-reduced-motion.
API Reference#
| Prop | Type | Default |
|---|---|---|
backgroundImagesRing card face images. Each card is stacked at the center and rotated by i * step; only corners extending past the center card are visible. | EditorialImageStackImage[] | — |
foregroundImagesCenter card images, cycled in sync with each rotation step. Each item should include a meaningful alt description. | EditorialImageStackImage[] | — |
countNumber of ring cards. Angle step is 360 / count (18° for 20 cards). | number | 20 |
cardSizeFixed card size in pixels. If omitted, scales responsively with the parent container via --stack-size. | number | 330 |
centerSizeCenter card size in pixels. Defaults to the card size. | number | cardSize |
centerScaleMultiplier applied to cardSize to derive centerSize when centerSize is not set. | number | 1 |
intervalMilliseconds between rotation steps. | number | 3000 |
switchIntervalMsAlias for interval. | number | 3000 |
transitionMsStep transition duration in milliseconds. Only transform is animated. | number | 500 |
rotationStepDegrees per step. | number | 360 / count |
driftSpeedContinuous drift in degrees per second between steps. | number | 0.75 |
autoRotateWhether the stack auto-steps and drifts. Center image still changes when false. | boolean | true |
backdropTextOptional large background typography behind the ring, visible at the edges. | string | — |
easingCSS easing for step transitions. | string | "cubic-bezier(0.22, 1, 0.36, 1)" |
paletteOverride the default 5-color cycle: white, black, light grey, black, rust orange. | readonly string[] | — |
cardsExplicit per-card data (color, image, label). Overrides the generated palette cycle. | RadialCardStackItem[] | — |
ariaLabelAccessible name for the stack region. Ring cards are aria-hidden. | string | "Editorial image stack" |
classNameAdditional classes for the root. Give the stack a height context. | string | — |
Accessibility#
The root is a labelled region with aria-roledescription 'image stack'. The shuffling background cards are decorative and aria-hidden; the fixed foreground image exposes alt text for the current photograph. The shared animation tick stops offscreen and when the tab is hidden. Under prefers-reduced-motion the background drift, shuffle, and blur are removed, and foreground switches slow to a simple low-motion cadence.
Motion#
A single requestAnimationFrame tick drives both layers. Every switchIntervalMs (1100ms default) the fixed center card changes through a 300ms GSAP blur-crossfade with a brief color tint while the seven background cards shuffle to new positions over 360ms ease-out. The stack also drifts slowly through a +/-4.5-degree rotation over nine seconds. Background photographs sit at 0.7 opacity with dark, desaturated filters. The tick stops offscreen and in hidden tabs, and prefers-reduced-motion disables the drift, shuffle, and blur while slowing the image cadence.
Known constraints#
- The background renders up to eight photographs; bgCardCount defaults to seven and extra backgroundImages are ignored.
- The foreground cycles through every provided foregroundImages item using a preloaded two-image blur-crossfade, so more items extend the sequence rather than the stack.
- The center card defaults to 462px inside a 760×700 stage, about 61% of the composition width. The deck scales from the smaller container dimension up to 1×, so a very wide parent centers it with side whitespace.
- autoRotate={false} leaves the background drift and shuffle static while center image changes continue on the shared tick.
- switchIntervalMs controls both the center image change and the background shuffle so the two motions stay in sync.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

