Dependency-free animated text component.
See the codeDependency-free animated text morphing component for React, Vue, Svelte, and vanilla JavaScript.
pnpm i torph
import { TextMorph } from "torph/react";
<TextMorph>Hello world</TextMorph>;
Numeric words morph by place value: digits slide along the block axis and the symbols around them travel with the places they belong to. It is on by default, so any value containing a number already animates this way.
import { TextMorph } from "torph/react";
// 1,204 → 1,318 rolls the hundreds and tens, leaves the thousands alone
<TextMorph>{`$${total.toLocaleString("en")}`}</TextMorph>;
For a field somebody is typing in, pass the caret position so the update matches by position rather than by place value:
<TextMorph cursorIndex={caret}>{value}</TextMorph>;
Use physics-based spring easing by passing spring parameters to ease:
import { TextMorph } from "torph/react";
<TextMorph ease={{ stiffness: 200, damping: 20 }}>Hello world</TextMorph>;
See the package README for full API documentation.
pnpm install:all
pnpm dev
pnpm build
Follow me on Twitter.
You might also like:
Torph name and outlining the method in Family Values.(top 24 of 41)
1,937 followers · starred Feb 2026
4,596 followers · starred Sep 2026
6,580 followers · starred Mar 2026
1,741 followers · starred Sep 2026
Dependency-free animated text component.
See the codeDependency-free animated text morphing component for React, Vue, Svelte, and vanilla JavaScript.
pnpm i torph
import { TextMorph } from "torph/react";
<TextMorph>Hello world</TextMorph>;
Numeric words morph by place value: digits slide along the block axis and the symbols around them travel with the places they belong to. It is on by default, so any value containing a number already animates this way.
import { TextMorph } from "torph/react";
// 1,204 → 1,318 rolls the hundreds and tens, leaves the thousands alone
<TextMorph>{`$${total.toLocaleString("en")}`}</TextMorph>;
For a field somebody is typing in, pass the caret position so the update matches by position rather than by place value:
<TextMorph cursorIndex={caret}>{value}</TextMorph>;
Use physics-based spring easing by passing spring parameters to ease:
import { TextMorph } from "torph/react";
<TextMorph ease={{ stiffness: 200, damping: 20 }}>Hello world</TextMorph>;
See the package README for full API documentation.
pnpm install:all
pnpm dev
pnpm build
Follow me on Twitter.
You might also like:
Torph name and outlining the method in Family Values.(top 24 of 41)
1,937 followers · starred Feb 2026
4,596 followers · starred Sep 2026
6,580 followers · starred Mar 2026
1,741 followers · starred Sep 2026