Card Fan

Card Fan

A hand of cards fanned in an arc — hover one and it straightens and rises out of the fan while its neighbours part in sympathy.

Installation

▸ Run the following command

npx shadcn@latest add https://www.mellowui.com/r/card-fan.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/card-fan.tsx
  4. Import and use.

API Reference

PropTypeDefaultDescription
itemsReactNode[]Card faces, left of the fan first.
widthnumber190Card size in px.
heightnumber264Card height in px.
arcnumber52Total fan angle in degrees.
liftnumber56How far a hovered card rises out of the fan, in px.
onSelect(index: number) => voidCalled with the card index on click or Enter.
classNamestringAdditional CSS classes.