Squeeze In
Typed-on title for Remotion: characters appear one by one, left to right, and when the last letter arrives the whole word compresses its letter gaps and settles tighter.
To type a short title in character by character and have the whole word compress a little when the last letter arrives, use Squeeze In. It reveals the word one character at a time, left to right, then collapses every letter gap at once so the word settles tighter, with no caret, blur or bounce. Use it for a wordmark, brand name or short title in a product video or logo sting.
$ pnpm dlx shadcn@latest add @remocn/squeeze-inHow to build this in Remotion
You don't need a typewriter string.slice() loop plus a separate letterSpacing tween. Install the component and pass the word:
npx shadcn@latest add @remocn/squeeze-inIt is one interpolate() for the reveal and one for the squeeze, both clamped. The reveal is a clip-path: inset() wipe that uncovers one character every stagger frames, so the text never reflows while it types. The squeeze starts once the last character is uncovered: every character's right margin shrinks from squeeze em to zero over 16 frames with an ease-out cubic curve, and a translate keeps the word centered while it tightens. The schedule lives in timeline.ts, so the reveal and the squeeze can be moved or stretched separately through the timing prop (ids reveal and squeeze).
Good to know
- Length: 34 frames of motion at 30 fps (68 at 60 fps) with the default props. That is the minimum for its
Sequence; add your own hold on top. The Usage example below is a 60 fps composition, so the numbers it hands to Remotion (durationInFrames,Sequencelengths) are doubled. The component's own props counted in frames stay in 30 fps frames at any frame rate, see Frame rate. - Installs:
remotionfrom npm, plus the remocn helpersframe-rate,timeline. The shadcn CLI copies the source into your project. - Font: Geist Sans through the
--font-geist-sansCSS variable, with a system sans fallback. There is nofontFamilyprop: the font is set inline, so change it in the copied file; aclassNamefont does not override an inline style. - There is no blinking caret. For a typed line with a cursor use Typewriter.
Usage
The word is uncovered by an invisible wipe travelling left to right — as if a background-colored rectangle slides off the text, revealing character after character. Once the wipe clears the last character, every letter gap compresses leftward toward the first character simultaneously — one unified gap, so the word reads as settling tighter against its first letter. Motion profile measured frame-by-frame from the reference footage.
// src/Root.tsx
import { Composition } from "remotion";
import { SqueezeIn } from "@/components/remocn/squeeze-in";
const SqueezeInScene = () => <SqueezeIn text="Remocn" />;
export const RemotionRoot = () => (
<Composition
id="SqueezeIn"
component={SqueezeInScene}
durationInFrames={120}
fps={60}
width={1280}
height={720}
/>
);With Backdrop
The component renders transparent — supply the background via Backdrop. It ships single-theme; edit the copied file to re-theme colors.
import { Composition } from "remotion";
import { SqueezeIn } from "@/components/remocn/squeeze-in";
import { Backdrop } from "@/components/remocn/backdrop";
const SqueezeInScene = () => (
<Backdrop fill={{ type: "color", value: "#09090b" }}>
<SqueezeIn text="Remocn" color="#fafafa" />
</Backdrop>
);
export const RemotionRoot = () => (
<Composition
id="SqueezeIn"
component={SqueezeInScene}
durationInFrames={120}
fps={60}
width={1280}
height={720}
/>
);Props7
| Prop | Type | Default |
|---|---|---|
| textrequired | string— The text to assemble | |
| fontSize | number72 Font size in pixels | |
| stagger | number3 Frames of wipe travel per character; total reveal lasts stagger times the character count | |
| squeeze | number0.03 Extra gap between characters in em, collapsed to zero as one when the last character lands | |
| color | string"#171717" Text color (any valid CSS color) | |
| fontWeight | number400 CSS font-weight | |
| className | string— Optional className passed to the underlying span | |
- textrequiredstring
The text to assemble
- fontSizenumber
Font size in pixels
Default
72 - staggernumber
Frames of wipe travel per character; total reveal lasts stagger times the character count
Default
3 - squeezenumber
Extra gap between characters in em, collapsed to zero as one when the last character lands
Default
0.03 - colorstring
Text color (any valid CSS color)
Default
"#171717" - fontWeightnumber
CSS font-weight
Default
400 - classNamestring
Optional className passed to the underlying span
Common questions
How do I type a title letter by letter and compress the word when the last letter arrives?
Install Squeeze In with npx shadcn@latest add @remocn/squeeze-in and render <SqueezeIn text="Remocn" />. The characters are uncovered one by one, and the moment the last one lands every letter gap closes together.
How long does it take?
stagger frames per character plus 16 frames of squeeze, at 30 fps. "Remocn" with the default stagger of 3 runs 6 × 3 + 16 = 34 frames. The exported squeezeInLength(text, stagger) returns the number for any word.
Can I make the squeeze stronger?
Yes. squeeze is the extra gap per character in em before it collapses. Raise it from 0.03 to 0.08 for a more visible tightening.
Related effects
- Tracking In: the whole word collapses from wide letter spacing with blur, no typing.
- Typewriter: typed text with a caret.
- Per-Character Rise: letters rise into place one by one.
- Squeeze Out: condensed lines relax out to full width.