Axis Flex
Variable font animation for Remotion: one gradient word stretches and thickens like elastic, flexing width and weight on a wave before each letter snaps to a final style.
In Remotion, Axis Flex animates a single gradient word so it stretches and thickens like an elastic variable font: each letter rides a wave between a light condensed cut and a wide medium cut, changing width and weight, then snaps to a final style with a spring. Use it for a beat about flexibility or range, or to show off a variable typeface.
$ pnpm dlx shadcn@latest add @remocn/axis-flexHow to build this in Remotion
You don't need Roboto Flex or a hand-written font-variation-settings loop. Install the component and pass your word:
npx shadcn@latest add @remocn/axis-flexIt drives the wdth and wght axes of Mona Sans per letter with interpolate() and Easing.bezier, and the final snap is a spring() (damping 14, stiffness 170). Letter widths are measured before the first frame (held with delayRender) so the word stays centered while it flexes.
Good to know
- Length: 124 frames of motion at 30 fps (248 at 60 fps) with the default props; the demo plays 150 frames, which adds a hold. The timing is fixed: a longer composition only holds the last frame longer. The Usage example below is a 60 fps composition, so the numbers it hands to Remotion are doubled, see Frame rate.
- Installs:
remotion,@remotion/google-fontsfrom npm, plus the remocn helpersglide,frame-rate,timeline. The shadcn CLI copies the source into your project. - Font: loads Mona Sans as a variable font itself through
@remotion/google-fonts. A font you pass throughfontFamilymust havewdthandwghtaxes, and you load it. settleAtis in 30 fps frames at any composition frame rate (default 84), so you don't rescale it for 60 fps.- The final style is
wdth 120, wght 460, the wave runs betweenwdth 75, wght 200andwdth 125, wght 500. There is no prop for them: change theFINAL,LOWandHIGHconstants in the copied file.
Usage
// src/Root.tsx
import { Composition } from "remotion";
import { AxisFlex } from "@/components/remocn/axis-flex";
const AxisFlexScene = () => (
<AxisFlex word="flexible" line="One font, every mood" accent="#3B5BFD" />
);
export const RemotionRoot = () => (
<Composition
id="AxisFlex"
component={AxisFlexScene}
durationInFrames={300}
fps={60}
width={1280}
height={720}
/>
);Each letter rides an equalizer wave between a light condensed cut and a wide medium cut, so the word breathes in width and weight. At frame 84 the letters snap one by one to the final style with a spring, then the narrow second line squeezes in underneath. Pass word and line; it ships light and dark through theme.
Props11
| Prop | Type | Default |
|---|---|---|
| word | string"elastic" The word that flexes. | |
| line | string"One family, every width" Second line, set in the narrow cut under the word. | |
| accent | string"#3B5BFD" Accent color blended into the word's gradient fill. | |
| background | string— Background fill; pass "transparent" to drop it. | |
| fontFamily | string"Mona Sans" Typeface for the copy. Mona Sans loads by default; load any other face in your project first. | |
| settleAt | number84 Frame the letters stop flexing and snap to their final cut; the second line follows. | |
| stagger | number2 Frames between letters as they snap. | |
| 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" Ships light and dark. | |
| speed | number1 Playback speed multiplier. | |
- wordstring
The word that flexes.
Default
"elastic" - linestring
Second line, set in the narrow cut under the word.
Default
"One family, every width" - accentstring
Accent color blended into the word's gradient fill.
Default
"#3B5BFD" - backgroundstring
Background fill; pass "transparent" to drop it.
- fontFamilystring
Typeface for the copy. Mona Sans loads by default; load any other face in your project first.
Default
"Mona Sans" - settleAtnumber
Frame the letters stop flexing and snap to their final cut; the second line follows.
Default
84 - staggernumber
Frames between letters as they snap.
Default
2 - 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"
Ships light and dark.
Default
"dark" - speednumber
Playback speed multiplier.
Default
1
Common questions
How would I animate a single gradient word in Remotion so it stretches and thickens like an elastic variable font?
Install Axis Flex with npx shadcn@latest add @remocn/axis-flex and pass word and line. It flexes width and weight per letter, then snaps each letter to the final style at settleAt.
Can I choose the final weight and width?
Not through props. Edit the FINAL constant in the copied file.
Related effects
- Weight Wave: a weight swell across the letters with no width change.
- Font Cycle: one word flipping through different typefaces.
- Shed Weight: one line at growing sizes with optical weights.
- Enhance Count: a thin blurry line that sharpens into a heavier weight.