Rubberband Word
A mouse cursor grabs a word by its last letter, stretches it like a rubber band, lets go, and the word snaps back into a new word with an accent period. A free, MIT-licensed Remotion text animation.
In Remotion, Rubberband Word has a mouse cursor grab the last letter of a word and stretch it out like a rubber band; on release the word snaps back, overshoots and turns into a new word with an accent period. Use it for a tension-and-release beat or a tagline that changes one word with a physical gesture.
$ pnpm dlx shadcn@latest add @remocn/rubberband-wordHow to stretch a word like a rubber band with a cursor in Remotion
A cursor pulling a word by its end like elastic until it snaps into a new word is one component. You don't need @remotion/paths or Easing.elastic:
npx shadcn@latest add @remocn/rubberband-wordwordis the word the cursor grabs,snapWordwhat it becomes. An emptysnapWordkeeps the word and only accents it.- The cursor approaches, presses, and drags the last letter out on a band while the other letters spread and squash. After
holdframes it lets go, the band fades, and the word springs back withspring()before swapping. stretchsets how far the pull goes: 1 is a fifth of the frame width. Values above 1 are not clamped, so a large stretch can reach past the frame edge.- Long words shrink: the type size is the smaller of 27% of the frame height and what fits the longer of the two words in 54% of the frame width.
- The cursor is a black arrow with a white outline. Its look is not a prop; change it in the copied file.
For a smooth letter morph with no cursor use Kinetic Morph Text.
Good to know
- Length: 90 frames of motion at 30 fps (180 at 60 fps) with the default props. The Usage example runs 260 frames at 60 fps, which adds a hold. The props counted in frames stay in 30 fps frames at any frame rate, see Frame rate.
- Installs:
remotion,@remotion/google-fontsfrom npm, plus the remocn helpersglide,frame-rateandtimeline. The shadcn CLI copies the source into your project. - Font: loads Sora through
@remotion/google-fonts. There is nofontFamilyprop: the letter widths of the stretch are tuned to Sora.
Usage
// src/Root.tsx
import { Composition } from "remotion";
import { RubberbandWord } from "@/components/remocn/rubberband-word";
const RubberbandWordScene = () => (
<RubberbandWord word="stretch" snapWord="deliver" />
);
export const RemotionRoot = () => (
<Composition
id="RubberbandWord"
component={RubberbandWordScene}
durationInFrames={260}
fps={60}
width={1280}
height={720}
/>
);A cursor reaches in, grabs the last letter of word and pulls it out on a taffy band while the letters spread and squash. On release the word snaps back, overshoots, and swaps to snapWord, closing with an accent period. Pass word and snapWord. It takes a theme prop and ships light and dark.
Props12
| Prop | Type | Default |
|---|---|---|
| word | string"tension" The word the cursor grabs by its last letter. | |
| snapWord | string"release" What the word becomes on the snap. Empty keeps the word and only accents it. | |
| period | booleantrue Close the final word with an accent period. | |
| hold | number8 Frames the stretched word holds before it snaps back. | |
| stretch | number1 How far the cursor pulls the last letter; 1 is a fifth of the frame width. | |
| accent | string"#3B5BFD" Color of the pulled letter and the closing period. | |
| ink | string— Text color; overrides the theme ink. | |
| background | string— Background fill; pass "transparent" to drop it. | |
| scale | number1 Size of the foreground around the frame's center; the background stays put. | |
| delay | number0 Frames to hold the first frame before anything moves. | |
| theme | "dark" | "light""dark" Light or dark ground; the component ships both. | |
| speed | number1 Playback speed multiplier for the whole timeline. | |
- wordstring
The word the cursor grabs by its last letter.
Default
"tension" - snapWordstring
What the word becomes on the snap. Empty keeps the word and only accents it.
Default
"release" - periodboolean
Close the final word with an accent period.
Default
true - holdnumber
Frames the stretched word holds before it snaps back.
Default
8 - stretchnumber
How far the cursor pulls the last letter; 1 is a fifth of the frame width.
Default
1 - accentstring
Color of the pulled letter and the closing period.
Default
"#3B5BFD" - inkstring
Text color; overrides the theme ink.
- backgroundstring
Background fill; pass "transparent" to drop it.
- scalenumber
Size of the foreground around the frame's center; the background stays put.
Default
1 - delaynumber
Frames to hold the first frame before anything moves.
Default
0 - theme"dark" | "light"
Light or dark ground; the component ships both.
Default
"dark" - speednumber
Playback speed multiplier for the whole timeline.
Default
1