Ruler Align
Jumbled, uneven letters sitting at random heights get straightened when a ruler slides beneath the line, levels, and lifts them onto one straight baseline; then the letter spacing tightens. A free, MIT-licensed Remotion text animation.
In Remotion, Ruler Align takes a line of jumbled, uneven text, slides a ruler beneath it and straightens every letter onto the ruler's edge. Use it for a precision, polish or alignment beat where messy type snaps into order.
$ pnpm dlx shadcn@latest add @remocn/ruler-alignHow to straighten jumbled text with a sliding ruler in Remotion
Uneven letters getting lined up by a ruler that slides under them is one component, so you don't need to write per-letter spring() code or add @remotion/noise for the scatter. Install it and pass your line:
npx shadcn@latest add @remocn/ruler-align- The letters fade in one by one (
stagger) at scattered heights. A ruler slides in under the line, levels, then rises so the high letters drop onto its edge; two taps then nudge the letter spacing tight. textsets the line,accentthe color of the ruler's straight edge. Letters without descenders sit best on the edge.- The scatter is fixed by the component: there is no prop for how messy the line starts or for the ruler's shape beyond
accent. Since you own the source, edit it incomponents/remocn/ruler-alignif you need that. - Each step (letters, ruler, level, rise, drops, taps) is an element in
timeline.ts, so thetimingprop can move or stretch one by id.
If only the letter spacing should tighten, use Kerning Snap.
Good to know
- Length: 151 frames of motion at 30 fps (302 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 with a hold, so itsdurationInFramesis longer than twice the motion. The component's own 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-rate,timeline. The shadcn CLI copies the source into your project; nothing else is needed at runtime. - Font: loads Geist (weight 300) itself through
@remotion/google-fonts, so the default needs no setup. PassfontFamilyto use your own face, and load that font in your project.
Usage
// src/Root.tsx
import { Composition } from "remotion";
import { RulerAlign } from "@/components/remocn/ruler-align";
const RulerAlignScene = () => <RulerAlign text="Made to measure." accent="#3B5BFD" />;
export const RemotionRoot = () => (
<Composition
id="RulerAlign"
component={RulerAlignScene}
durationInFrames={450}
fps={60}
width={1280}
height={720}
/>
);The letters appear scattered at uneven heights, a ruler slides in beneath them, levels, then lifts so high letters drop onto its edge. Two taps then nudge the spacing tight. Pass text for your own line; letters without descenders sit best on the edge. It takes a theme prop and ships light and dark.
Props11
| Prop | Type | Default |
|---|---|---|
| text | string"Made to measure." The line the ruler straightens. Letters without descenders sit best on the edge. | |
| fontWeight | number300 Weight of the line. | |
| stagger | number2 Frames between letters as they fade in. | |
| accent | string"#3B5BFD" The ruler's straight edge. | |
| ink | string— Text color; overrides the theme ink. | |
| background | string— Background fill; pass "transparent" to drop it. | |
| fontFamily | string"Geist" Typeface for the copy. Load the font in your project first. | |
| 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. | |
- textstring
The line the ruler straightens. Letters without descenders sit best on the edge.
Default
"Made to measure." - fontWeightnumber
Weight of the line.
Default
300 - staggernumber
Frames between letters as they fade in.
Default
2 - accentstring
The ruler's straight edge.
Default
"#3B5BFD" - inkstring
Text color; overrides the theme ink.
- backgroundstring
Background fill; pass "transparent" to drop it.
- fontFamilystring
Typeface for the copy. Load the font in your project first.
Default
"Geist" - 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