Splay Cards

Splay Cards

A leaning rack of 3D plates — hover one and the stack splays open, the chosen plate turning to face you while its title takes over the caption line.

Hover a card · the rack splays open

Installation

▸ Run the following command

npx shadcn@latest add https://www.mellowui.com/r/splay-cards.json

▸ Or install manually

  1. Install dependencies: pnpm add motion
  2. Copy the source from the Code tab above.
  3. Place it at components/mellow/splay-cards.tsx
  4. Import and use.

API Reference

PropTypeDefaultDescription
itemsSplayCardsItem[]Plates in the rack. Each item is `{ title, meta?, content }`.
headingstringCaption line shown while nothing is active.
widthnumber230Plate width in px.
heightnumber330Plate height in px.
spacingnumber56Horizontal offset between resting plates in px.
splaynumber96How far the rear plates slide when the stack parts, in px.
leannumber46Resting lean of each plate in degrees.
onActiveChange(index: number | null) => voidFired when the active plate changes.
classNamestringAdditional CSS classes.