Cards
CreativeStack Card
The next card rises to meet you and the deck loops. Arrow keys and buttons do the same.
Install
Included with Creative: needs your API key. Initialize and log in once.
npx @galactrex/ui add stack-cardUsage
import { StackCard } from "@/components/galactrex/stack-card";
<StackCard><Quote /><Quote /><Quote /></StackCard>Source
Installs to components/galactrex/stack-card.tsx, with the shared motion primitives beside it.
Source for this component comes with its plan. Install it with the command above, or open your licensed copy here.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | One child per card. |
threshold | number | 110 | Fling distance in px. |
depth | number | 2 | Cards behind. |
onSwipe | (index, direction) => void | — | Each card that leaves. |
className | string | — | Extra classes for the outer element. |
Variants
- Testimonials. Quotes to flick through.
Accessibility
- Arrow keys and labelled buttons; hidden cards are aria-hidden.
Motion and reduced motion
- Drag with rotation, spring stacking, fling exit.
- Reduced motion: fades, no drag.