Installation
Usage
Props
The text content to display
CSS classes for text styling
CSS classes for the container element
Spacing between split sections (in pixels)
Features
- Hover Effect: Text splits on hover
- Smooth Animation: Fast 0.1s transition
- Clip Path: Uses CSS clip-path for clean slicing
- Customizable Spacing: Control gap between slices
How It Works
- Default State: Text appears split with top and bottom halves slightly separated
- Hover State: Halves merge together, top half fades out
- Clip Path: Top half shows upper 50%, bottom half shows lower 50%
Customization
Adjust Split Spacing
Container Styling
Animation Variants
- Top Half: Clips bottom 50%, moves up, fades on hover
- Bottom Half: Clips top 50%, moves down, stays visible on hover
Dependencies
motion/react- Animation library@/lib/utils- cn utility function