Per-character layout morphing for labels, counters, and live text swaps, powered by Motion. React component.
Made by AxylExamples
Text Morph Input
Installation
File Structure
Usage
Cycle copy on click:
Live morph while typing:
Props
| Prop | Type | Default |
|---|---|---|
children? | string | - |
as? | ElementType | "p" |
variant? | "blur" | "slide" | - |
staggerDelay? | number | 0 |
skipUnchanged? | boolean | false |
charClassName? | string | - |
live? | "off" | "polite" | "assertive" | "off" |
variants? | Variants | - |
transition? | Transition | - |
className? | string | - |
When to Use
Use TextMorph for label swaps that need to feel fluid rather than abrupt: copy buttons toggling "Copy" → "Copied", tab selectors, status badges, or counters where a hard cut feels jarring. It is most effective on short text (1–15 characters) where individual character transitions are clearly visible.
For longer text or entire paragraphs that change, a fade transition is simpler and more legible.
Accessibility
Set live="polite" when the content change is the result of a user action that screen reader users should be notified about (e.g., "Copied"). Use live="assertive" only for urgent status updates. The morphing animation is visual only; the final string is announced by the live region after the transition completes. When prefers-reduced-motion: reduce is set, the component skips the character-by-character morph via useReducedMotion() and renders the text directly — no extra configuration needed.
Credits
Inspired by motion-primitives.
Built by Axyl. A motion-first component registry for React.
Last updated: 7/26/2026