paths
| paths |
| src/components/**/*.tsx |
| src/hooks/**/*.ts |
|
v2 to v4 Transformation
Quick Reference
| v2 |
v4 |
| GSAP + ScrollTrigger |
motion/react with whileInView |
| Character-level text hooks |
TextAnimation component (word-level) |
buttons: ButtonConfig[] |
primaryButton / secondaryButton objects |
| 10+ className props |
Single className prop |
| CardStack/TextBox wrappers |
Direct composition |
| Complex media props |
Discriminated union: { imageSrc } | { videoSrc } |
Animation Variants
| v2 |
v4 |
entrance-slide |
slide-up |
reveal-blur |
fade-blur |
background-highlight |
fade |
Allowed Hooks
Only 2 custom hooks exist in v4:
useCarouselControls - Embla carousel state
useButtonClick - Navigation handling
All other animation hooks are replaced by TextAnimation, Button animate, or inline motion.
Standard Motion Animation
Props Pattern
Checklist
- Replace GSAP with
motion/react
- Replace animation hooks with
TextAnimation or Button animate
- Use discriminated unions for media props
- Use
primaryButton/secondaryButton instead of buttons array
- Remove all className props except single
className
- Replace CardStack with
GridOrCarousel
- Replace TextBox with direct
TextAnimation + Button composition
- Add
aria-label to sections
- Use
w-content-width for containers