Stretch In
Bold title entrance for Remotion: letters rush in from outside the frame with a horizontal smear, crossbars stretch long while vertical stems keep their width, then snap crisp.
To make the letters of a bold title rush in from outside the frame with a horizontal smear, where crossbars stretch but vertical stems stay the same width, use Stretch In. It flies a heavy display word in from the right letter by letter, deforms the real glyph outlines on the way and snaps each letter back crisp. It is not a scaleX or motion blur, so stems never get fatter.
$ pnpm dlx shadcn@latest add @remocn/stretch-inHow to build this in Remotion
You don't have to write the opentype.js glyph parsing and per-vertex deformation yourself. Install the component and pass the word:
npx shadcn@latest add @remocn/stretch-inIt fetches the font file at fontUrl under delayRender, parses the outlines with opentype.js and draws each letter as an SVG <path>. Every point of a letter travels from off-canvas to rest with interpolate() on an ease-out bezier, but each point starts later in proportion to its distance from the letter's leading edge, up to vertexLagFrames. Horizontal strokes, whose points are spread along x, get pulled long; vertical stems, whose points share an x, move together and keep their width. Letters enter entryStagger frames apart, each over travelFrames.
Good to know
- Length: 48 frames of motion at 30 fps (96 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:
remotion,opentype.jsfrom npm, plus the remocn helpersframe-rate,timeline. The shadcn CLI copies the source into your project. - The letters are drawn from the font's outlines with
opentype.js, loaded fromfontUrl(Anton from Google Fonts' CDN by default). For offline or locked-down renders, put the.ttfinpublic/and passfontUrl={staticFile("Anton.ttf")}. - The word enters from the right.
Usage
// src/Root.tsx
import { Composition } from "remotion";
import { StretchIn } from "@/components/remocn/stretch-in";
const StretchInScene = () => <StretchIn text="REMOCN" />;
export const RemotionRoot = () => (
<Composition
id="StretchIn"
component={StretchInScene}
durationInFrames={120}
fps={60}
width={1920}
height={1080}
/>
);The letters are geometry, not text: glyph contours are parsed out of the font
file (opentype.js), so the animation can reach inside the letterforms. Each
vertex starts its travel late in proportion to how far it sits from the
letter's leading edge — the leading edge lands first, the trailing edge catches
up, and the letter smears without its stems changing width. Counters (the holes
in P, O, R) go through the same deformation, so they never detach.
fontUrl defaults to Anton served from Google Fonts' static CDN, so it works
out of the box; point it at any .ttf/.otf URL to change the face. The
render is held until the font file has loaded.
Props15
| Prop | Type | Default |
|---|---|---|
| text | string"REMOCN" The text to fly in — short display words read best | |
| fontUrl | stringAnton (gstatic ttf) URL of a .ttf/.otf font file the glyph outlines are parsed from | |
| fontSize | number510 Font size in comp pixels | |
| letterSpacing | number0 Extra spacing between letters in comp pixels | |
| fill | string"#ffffff" Fill of the letterforms | |
| strokeWidth / stroke | number / string0 / "#ffffff" Set `fill` to "none" and `strokeWidth` to 2 for the wireframe authoring view | |
| width / height | number1920 / 1080 Coordinate space of the composition. The word centers horizontally | |
| baselineY | numbervertically centered Baseline of the word in comp pixels | |
| entryStart | number0 Frame the first letter starts its travel | |
| entryStagger | number3 Frames between consecutive letters' entries | |
| travelFrames | number33 Frames one letter takes from off-canvas to rest | |
| travelDistance | number1500 How far off-canvas right the letters start, in comp pixels | |
| vertexLagFrames | number3.5 Frames the trailing edge lags the leading edge. This is the smear | |
| curveSteps | number8 Line segments each glyph curve is sampled into — every vertex must take part in the deformation | |
| className | string— Optional className passed to the wrapper | |
- textstring
The text to fly in — short display words read best
Default
"REMOCN" - fontUrlstring
URL of a .ttf/.otf font file the glyph outlines are parsed from
Default
Anton (gstatic ttf) - fontSizenumber
Font size in comp pixels
Default
510 - letterSpacingnumber
Extra spacing between letters in comp pixels
Default
0 - fillstring
Fill of the letterforms
Default
"#ffffff" - strokeWidth / strokenumber / string
Set `fill` to "none" and `strokeWidth` to 2 for the wireframe authoring view
Default
0 / "#ffffff" - width / heightnumber
Coordinate space of the composition. The word centers horizontally
Default
1920 / 1080 - baselineYnumber
Baseline of the word in comp pixels
Default
vertically centered - entryStartnumber
Frame the first letter starts its travel
Default
0 - entryStaggernumber
Frames between consecutive letters' entries
Default
3 - travelFramesnumber
Frames one letter takes from off-canvas to rest
Default
33 - travelDistancenumber
How far off-canvas right the letters start, in comp pixels
Default
1500 - vertexLagFramesnumber
Frames the trailing edge lags the leading edge. This is the smear
Default
3.5 - curveStepsnumber
Line segments each glyph curve is sampled into — every vertex must take part in the deformation
Default
8 - classNamestring
Optional className passed to the wrapper
Inspired by Stretched Type In After Effects by Ben Marriott.
Common questions
How do I make letters rush in from off screen with a horizontal smear in Remotion?
Install Stretch In with npx shadcn@latest add @remocn/stretch-in and render <StretchIn text="REMOCN" />. The smear comes from the outlines themselves, so it works with any .ttf or .otf you point fontUrl at.
Why do the vertical stems keep their width?
The deformation delays each outline point by its horizontal position inside the letter. Points on a vertical stem share the same position, so they move as one; crossbars and bowls are spread out, so they stretch.
Can the smear be longer or shorter?
Yes. vertexLagFrames is the lag between the leading and trailing edge, 3.5 frames by default. Raise it for a longer smear, lower it for a tighter one. travelDistance sets how far right of the frame the letters start.
Does it work for small text?
It reads at display sizes. For body-size text use Per-Character Rise.
Related effects
- Short Slide Right: a plain slide-in when you can't load a font file.
- Italic Speed: a slanted caps word rides in on speed lines.
- Kinetic Warp: a heavy word bends and snaps through a mesh warp.
- Full Bleed Type: huge condensed words slam in one at a time.