<MorphText> component from griffo/morph.
Content
The text content to display. When this changes, the component will morph between the old and new text.
Split options
How to split the text into tokens for morphing.
"chars"- Split into individual characters"words"- Split into words (separated by spaces)
Animation props
Animation state for entering tokens. Can be a static object or a function that receives variant info.Static:Function:MorphVariantInfo:
index- Index of this token among all animated tokenscount- Total number of animated tokens
Target animation state for all visible tokens.Static:Function:
Animation state for exiting tokens.Static:Function:
Default transition options for all animations.Supports all Motion transition options including springs, tweens, and easing functions.
Delay between each token’s animation in seconds.This is a convenience prop that applies stagger to entering tokens. For more control, use function variants with custom transition delays.
Whether to animate on initial mount.When
false (default), the first render will skip the initial animation and render directly in the animate state.Styling
The HTML element to render as the wrapper.
CSS class name for the wrapper element.
Inline styles for the wrapper element.
Behavior
Whether to wait for fonts to load before rendering.Set to
false if you’re using system fonts or have already loaded fonts.How to handle prefers-reduced-motion.
"user"- Respect system preference"always"- Always reduce motion"never"- Never reduce motion
Callbacks
Called when the morph animation completes.
Other props
<MorphText> also accepts all other HTML attributes and Motion props not listed above (excluding controlled props like children, initial, animate, exit).