ValyroUI English version

Folded Depth Cards

Карточки слоями в глубину: складываются как бумага, клавиатура и свайп. Pro · Анимированные компоненты › Слои и раскрытие

Установка

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';

Пропсы

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.

Похожие компоненты

  • Halftone Image Reveal — Изображение проявляется растровыми точками: при прокрутке, наведении или появлении
  • Toggle — Кнопка-переключатель с пружинным откликом
  • Flip Button — Кнопка с двумя сторонами, переворачивается на пружине
  • Liquid Button — Кнопка, которая заполняется «жидкостью» при наведении
  • Theme Toggler — Смена светлой и тёмной темы с раскрытием через View Transitions
  • GitHub Stars Button — Ссылка на репозиторий с прокручивающимся числом звёзд
  • Share Button — Кнопка, раскрывающая иконки соцсетей
  • Code Tabs — Варианты кода во вкладках: npm, pnpm, bun — с копированием
  • Number Wheel — Число на вращающемся барабане с соседними значениями
  • Pin List — Список с закреплением: элементы плавно переезжают между группами
  • Notification Stack — Стопка уведомлений, раскрывающаяся в список
  • Todo List — Чек-лист с волнистым зачёркиванием выполненных пунктов

Назад: Link Preview · Далее: Halftone Image Reveal · Весь раздел «Анимированные компоненты»