Factor Out

Shared-ending text stack for Remotion: three short action phrases stack up and merge over one big accent line like in your editor, to show they happen in one place.

In Remotion, Factor Out stacks three short action phrases over one big accent line such as "in your editor.", to show they all happen in the same place. Use it for a feature beat where several actions share one location, tool or result.

Installation
$ pnpm dlx shadcn@latest add @remocn/factor-out

How to build this in Remotion

You don't need @remotion/transitions or a staggered Sequence per line. Install the component and pass the phrases:

bash
npx shadcn@latest add @remocn/factor-out

The lines enter, align and merge on the schedule in timeline.ts, which scales its pacing to the composition length (between 0.85× and 1.5×). Every move is interpolate() with Easing, and the tail color uses interpolateColors(). Text widths are measured on a canvas before the first frame, held with delayRender.

Good to know

  • Length: 153 frames of motion at 30 fps (306 at 60 fps) with the default props. The demo plays 190 frames; the pacing stretches or tightens with the composition length. 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-fonts from npm, plus the remocn helpers glide, frame-rate, timeline. The shadcn CLI copies the source into your project.
  • Font: loads Rubik itself through @remotion/google-fonts. Pass fontFamily to use your own face, and load that font in your project.
  • Default accent: #7CC4FF, a light blue, on the dark theme's #2A1033 ground; the light theme uses #2B7BD6 on #F3EEF5. Pass accent for an exact brand blue.

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { FactorOut } from "@/components/remocn/factor-out";
 
const FactorOutScene = () => <FactorOut heads={["Write the scenes", "Pick the colors", "Fix the typos"]} tail="in your editor." />;
 
export const RemotionRoot = () => (
  <Composition
    id="FactorOut"
    component={FactorOutScene}
    durationInFrames={380}
    fps={60}
    width={1280}
    height={720}
  />
);

Short imperative lines enter one by one and align, then the shared tail merges out of them: lines collapse one at a time until a single stack sits above a big tail phrase. Pass heads (the repeated beginnings) and tail (the shared ending).

Props12

PropTypeDefault
heads
string[]DEFAULT_HEADS

Short repeated lines that stack, one per row.

tail
stringDEFAULT_TAIL

Shared ending shown large after the lines merge.

stagger
number8

Frames between one line entering and the next.

accent
string—

Color of the tail phrase; defaults to the theme accent.

ink
string—

Text color; overrides the theme ink.

background
string—

Stage fill color; pass "transparent" to overlay your own footage.

fontFamily
string"Rubik"

Typeface for the copy. Rubik loads by default; load any other face in your project first.

fontWeight
number500

Weight of the lines and the tail.

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.

speed
number1

Playback multiplier for the whole timeline.

theme
"dark" | "light""dark"

Color scheme; ships dark and light.

  • headsstring[]

    Short repeated lines that stack, one per row.

    DefaultDEFAULT_HEADS

  • tailstring

    Shared ending shown large after the lines merge.

    DefaultDEFAULT_TAIL

  • staggernumber

    Frames between one line entering and the next.

    Default8

  • accentstring

    Color of the tail phrase; defaults to the theme accent.

  • inkstring

    Text color; overrides the theme ink.

  • backgroundstring

    Stage fill color; pass "transparent" to overlay your own footage.

  • fontFamilystring

    Typeface for the copy. Rubik loads by default; load any other face in your project first.

    Default"Rubik"

  • fontWeightnumber

    Weight of the lines and the tail.

    Default500

  • 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

  • speednumber

    Playback multiplier for the whole timeline.

    Default1

  • theme"dark" | "light"

    Color scheme; ships dark and light.

    Default"dark"

Common questions

How do I stack three action phrases over a big blue line like in your editor in Remotion?

Install Factor Out with npx shadcn@latest add @remocn/factor-out, pass the phrases as heads and the shared ending as tail. The lines stack and merge over the big tail.

What blue is the tail?

On the dark theme it is #7CC4FF; on the light theme #2B7BD6. Pass accent to set your own.

Does it work with more or fewer than three phrases?

heads is a list, so it takes other counts; the scene paces them to fit the composition length.