ValyroUI Русская версия

Folded Depth Cards

Cards layered in depth that fold like paper, with keyboard and swipe. Pro · Animated components › Layers and reveals

Marketing cards stacked in depth: the front card is live, the ones behind recede and fold, and a passed card folds away like paper (or, in the fold layout, the deck opens like a fan). Arrow keys, buttons, dots and swipes move between them; only the front card can be focused. Motion is CSS on the compositor with a spring easing, and a static layout replaces it under reduced motion.

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add folded-depth-cards
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { FoldedDepthCards } from 'valyro-ui-pro';

Props

PropTypeDefault
items *DepthCardItem[]The cards, front to back.
activenumberIndex of the front card.
defaultActivenumber0Initial front card when uncontrolled. Default 0.
onActiveChange(index: number) => voidCalled when another card comes to the front.
layout'stack' | 'fold''stack'stack: a deck receding in depth, the passed card folds away; fold: a paper fan, the front card unfolded.
depthnumber64How far each layer recedes, in px. Default 64.
visiblenumber3Layers drawn behind the front card in the stack. Default 3.
springSpringPreset | SpringConfig | 'none''gentle'Motion of the fold: a preset, your own spring, or none for the theme's easing. Default gentle.
interactivebooleantrueTilt toward the pointer and swipe between cards. Default true. Vertical scrolling is never blocked.
reducedMotion'auto' | 'always' | 'never''auto'auto (default) follows the reader's setting; always renders the static, motion-free layout; never animates regardless.
loopbooleanfalseWrap from the last card to the first.
heightCSSProperties['height']Height of the card area. Default 22rem.
loadingbooleanfalseCards are loading: skeleton.
errorReactNodeLoading failed: shown instead of the cards.
headingLevel2 | 3 | 4 | 5 | 63Level of the card titles (default 3).
labelsPartial<FoldedDepthCardsLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Link Preview · Next: Halftone Image Reveal · All Animated components