Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Card Stack

Pro

A stack of cards you can drag, swipe, click or arrow through.

Installation

pnpm dlx shadcn@latest add @viewport/card-stack

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
items*T[]—
render*(item: T, index: number) => React.ReactNode

Renders one card.

—
autoplaynumber

Advance automatically every N milliseconds. Paused on hover and focus.

—
labelstring

Accessible name for the carousel.

"Cards"
classNamestring—

Accessibility

  • Exposed as a carousel; arrow keys and buttons change cards.
  • Announces the position through a live region.
  • Cards behind the top one are inert.
  • Autoplay pauses on hover and focus and is off under reduced motion.