Непрерывность при перестановке

FLIP, индикаторы вкладок и раскрытие карточек.

MotionFLIPWAAPIlayoutперестановка

Когда использовать

Animate meaningful layout changes without losing object identity or focus.

Решения для реализации

  1. Measure first rectangles before changing the order, then last rectangles in a layout effect after React commits.
  2. Use stable data keys to match the same item across positions. Animate an inverse transform to identity with WAAPI.
  3. Cancel previous Animation objects before starting a replacement and on unmount. If reduced motion is enabled, apply the final layout immediately.
  4. Keep keyboard focus on the same semantic element. A transform must not change logical DOM ordering or tab behavior.

Как проверить результат

  • The same card travels between its old and new positions.
  • Repeated reorder clicks interrupt cleanly.
  • Focus and reduced-motion behavior remain predictable.

Файлы

SKILL.mdcomponents/advanced-motion.tsx
WEBCRAFT © 2026Оригинальные исходники и интерактивные примерыMIT License