A card component with an animated SVG stroke and word-by-word text reveal on hover.
Installation
Note: This component uses GSAP with the SplitText plugin for word-based animations. It is inspired by this amazing post by joaopaulots
Usage
How It Works
- Uses GSAP timelines for hover animations.
- Uses SplitText to animate title and description word-by-word.
- SVG paths are animated using
strokeDasharrayandstrokeDashoffset.
On Hover
- Stroke expands and reveals.
- Title and description slide up into view.
On Mouse Leave
- Stroke retracts.
- Text animates back down.
API Reference
CardStroke
| Prop | Type | Default |
|---|---|---|
title? | string | Card Title |
description? | string | A small two line paragraph passed by prop. |
imageSrc? | string | /templateImages/placeholder.png |
imageAlt? | string | Card background |
accentStrokeColor? | string | #E0E0E0 |
baseStrokeColor? | string | #2B7FFF |
textColor? | string | #F5F5F5 |
className? | string | - |
