Ruler Align

A ruler slides under a messy line of text and straightens its letters onto the edge. A free, MIT-licensed Remotion text animation.

Installation
$ pnpm dlx shadcn@latest add @remocn/ruler-align

Usage

tsx
// 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={225}
    fps={30}
    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

PropTypeDefault
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.

    Default300

  • staggernumber

    Frames between letters as they fade in.

    Default2

  • 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.

    Default1

  • delaynumber

    Frames to hold the first frame before anything moves.

    Default0

  • theme"dark" | "light"

    Light or dark ground; the component ships both.

    Default"dark"

  • speednumber

    Playback speed multiplier for the whole timeline.

    Default1