A fanned stack of prints. Drag the top card to skip, or open it for specs and Add to cart.
FreeWeb and MobileMotion
Preview
npx shadcn add @fetaui/card-stackPlayground
Rest
Dragging
Details
Low Sun$48
The last ten minutes of light over the bay, pulled in two inks.
- A3
- Cream 120g
- of 50
State
Icons animation
Motion
Installation
Terminal· bash
npx shadcn add @fetaui/card-stack
Accessibility
- The top print is a real button named by its title, meta and price. Prints behind it are hidden from screen readers.
- The arrows are labelled, so nothing needs dragging.
- The counter is announced politely.
Motion
- The top print follows the pointer and tilts by x / 20. The cards below move up one step as you drag.
- Past 30% of its width or at velocity 500 it flings away in 350 ms. Otherwise it springs back.
- Details scales the print up in 350 ms.
- With reduced motion, dragging is off and the arrows swap prints in place.
Responsive behavior
- 448 px on Web and 358 px on Mobile. The stage stays 380 px tall.
- Details grows the tray to fit, and Add to cart is taller on Mobile.
Performance
- At most four prints are in the DOM, whatever the length of items.
- A drag writes straight to the stage through a motion value, so it never re-renders per frame.
- The swap to a new top print runs before paint, so it never flashes.
Note for AI
Give your coding assistant the Markdown reference instead of screenshots.
- Import CardStack from @/components/fetaui/card-stack. Without items it shows five sample prints.
- Each item needs name, meta, price and art. description and specs fill the details view.
- Add to cart only calls onAdd. Wire it to your cart.
- The stack wraps at both ends. Past 30% of the card width, or at 500 px/s, a drag skips. Composes Card, Button and Icon Button.
Related
Card FlipComponentA ticket that turns in 3D. Both sides are the same size, and a shade peaks halfway round.Lightbox GridComponentA photo grid that opens into a viewer. The photo zooms out of its tile and returns to it.Notification StackComponentNotifications as inset cards on the tray. They fan when collapsed, list when expanded, and swipe away.CarouselComponentA rail of tall cards. The centred card grows to 106% and shows its price.Add to Cart ButtonComponentAdd opens into a quantity stepper in place.