<MorphText> component from griffo/morph provides smooth text morphing animations where matching tokens animate between positions, new tokens enter, and removed tokens exit.
Import
Basic usage
How it works
<MorphText> uses stable token identity to create smooth morphing animations:
- Matching tokens - Tokens that exist in both old and new text animate to their new positions
- Entering tokens - New tokens that didn’t exist before play the
initial→animatetransition - Exiting tokens - Removed tokens play the
animate→exittransition before unmounting
Split modes
Split by characters (default)
- Short text changes
- Character-by-character reveals
- Scramble effects
Split by words
- Longer text
- Word-based animations
- Status messages
Animation states
Initial state
Initial state
Applied to entering tokens before they animate in:
Animate state
Animate state
The target state for all visible tokens:
Exit state
Exit state
Applied to tokens that are being removed:
Transition options
Examples
Loading states
Status messages
Counter with stagger
Completion callback
Related
Props reference
Complete MorphText props documentation
Morph guide
In-depth guide with examples