Fanned Deck
A 3D fan of up to 14 portrait cards arranged on a curved arc. Each card is bent like a curved sheet (14 vertical slices, each rotated in 3D), the deck overlaps 40%, tilts outward, and bobs gently. Hovering a card lifts it to the front, straightens and uncurls it, spreads its neighbours, dims the rest, and pops a coloured username bubble. Deal, flip, rise, and sweep entrances replay on viewport re-entry.
Installation#
pnpm dlx shadcn@latest add @davinciui/fanned-deckUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
itemsUp to 14 cards, back to front. Each takes an image (or video), label, bubble colour, link, and a pinned flag that keeps its bubble visible. | FannedDeckItem[] | — |
backgroundStage colour behind the fan. | string | "#efefef" |
overlapHorizontal card step as a fraction of card width; 0.6 means 40% overlap. | number | 0.6 |
arcHow far the outer cards sit below the centre, as a fraction of card size. | number | 0.31 |
tiltY rotation per card in degrees; the live fan is asymmetric, so the whole deck leans -3.5deg. | number | 4.3333 |
curveY rotation per slice in degrees; bends each card. | number | 3.1429 |
sagHow far slice edges push toward the viewer, as a fraction of card size. | number | 0.0819 |
depthCSS perspective, in multiples of card size. | number | 2.8 |
cardRadiusCard corner radius in pixels. | number | 22 |
shadowDrop shadow under each card; deepens on hover. | boolean | true |
outlineShow a focus ring on focused cards. | boolean | false |
hoverLiftVertical lift of the hovered card in pixels. | number | 18 |
hoverScaleScale multiplier on the hovered card. | number | 1.06 |
hoverSpreadNeighbour push on hover; decays geometrically (x0.62) per card of distance. | number | 0.16 |
hoverStraightenHovered cards keep 40% of their tilt. | boolean | true |
hoverUncurlHovered cards uncurl to 45% of their curvature. | boolean | true |
edgeScaleScale of the outer cards relative to the centre (0.84 at centre); lower it for flatter fans. | number | 1 |
bubbleScaleScale of the username bubble; it shrinks toward the tail, so lower values also sit it closer to the card. | number | 1 |
dimOthersDark overlay strength on non-hovered cards. | number | 0.12 |
entranceEntrance animation; plays on load and replays on viewport re-entry. | "deal" | "flip" | "rise" | "sweep" | "deal" |
bobGentle per-card bob (5px, staggered). | boolean | true |
stackingOrderWhich end of the fan stacks on top. | "right-on-top" | "left-on-top" | "right-on-top" |
Accessibility#
The root is a role='list' and each card a focusable listitem with an aria-label (the @username). Hover and keyboard focus both activate a card (lift, uncurl, bubble), so focus is announced by the label and made visible through the lift. Linked cards are real anchors with target=_blank and rel=noopener noreferrer; Enter follows the link. On touch the first tap activates and the second follows the link. The bubble and shadow layers are aria-hidden decoration. prefers-reduced-motion skips the entrance and bob and renders the settled fan.
Motion#
All motion is CSS: layer transitions use a 560ms cubic-bezier(0.25,1.45,0.45,1) overshoot (slices 620ms cubic-bezier(0.3,1.35,0.5,1), bubble pop 480ms cubic-bezier(0.34,1.56,0.64,1), pointer tilt 260ms ease-out, dim 360ms). Hover writes the hovered index and the face tilt from the pointer. The entrance replays on viewport re-entry once images decode, staggering 70ms per card; per-card bob cycles 5.4/6.3/7.2s at 5px. prefers-reduced-motion skips the entrance and bob entirely.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

