Inline Word Roll

Rotating word animation for Remotion: the start of a headline stays put while the last word rolls vertically like a slot machine, speeding up through audiences or outcomes.

In Remotion, Inline Word Roll keeps the start of a headline in place while the last word rolls vertically, slot-machine style, through a list such as teams, founders and creators, speeding up as it goes. Use it for a who-it's-for or benefits line in a landing or launch video.

Installation
$ pnpm dlx shadcn@latest add @remocn/inline-word-roll

How to build this in Remotion

You don't need measureText(), @remotion/layout-utils or a motion-blur trail for this. Install the component and pass the prefix and words:

bash
npx shadcn@latest add @remocn/inline-word-roll

Each roll is an element in timeline.ts; the wait before each roll shrinks by acceleration. The outgoing word slides up and the next one comes from below with Easing.bezier(0.22, 0.75, 0.25, 1), and the words are measured with the real font after useDelayRender() waits for it, so the prefix shifts smoothly as the total width changes.

Good to know

  • Length: 75 frames of motion at 30 fps (150 at 60 fps) with the default props; the demo plays 105 frames, which adds a hold. The Usage example below is a 60 fps composition, so the numbers it hands to Remotion are doubled, see Frame rate.
  • Installs: remotion from npm, plus the remocn helpers glide, frame-rate, timeline. The shadcn CLI copies the source into your project.
  • Font: Arial by default (fontFamily prop). Load any webfont you pass in your project; the render waits for it before measuring.
  • Direction: the roll always goes upward; there is no direction prop. The curve is the bezier above; edit it in the copied file for a different feel.

Usage

The prefix remains on the baseline while the changing word rolls upward through a softly masked slot. The next word arrives from below. The whole line smoothly recenters as the word width changes, and successive switches get closer together. The first word starts readable and the final word stays on screen.

tsx
import { AbsoluteFill } from "remotion";
import { InlineWordRoll } from "@/components/remocn/inline-word-roll";
 
export const Headline = () => (
  <AbsoluteFill style={{ background: "#000" }}>
    <InlineWordRoll
      prefix="Looking for"
      text="leads | customers | subscribers | appointments | demos | quotes | registrants | trials | conversions"
      suffix="?"
    />
  </AbsoluteFill>
);

The default sequence finishes moving at frame 75. The demo adds a one-second final hold. All durations are 30 fps frames, so the movement takes about 2.5 seconds at any frame rate. Set acceleration={1} for a steady pace. Faster intervals never become shorter than the roll itself, so transitions cannot overlap.

Words and phrases are separated by | or newlines. Spaces inside a phrase are preserved. Empty entries are ignored. The component has a transparent background; add your own scene or texture behind it.

Props

PropTypeDefault
prefix
string"Looking for"

Text that stays on the baseline. Its horizontal position follows the changing total width.

text
string"leads | customers | … | conversions"

Words or phrases separated by | or newlines.

suffix
string"?"

Appended to every changing word and rolls with it.

fontSize
number60

Font size in composition pixels. The whole line scales down to fit the longest phrase within 84% of frame width.

fontFamily
string"Arial, Helvetica, sans-serif"

Font family. Load custom font faces in your composition; measurement waits for the selected face.

fontWeight
number400

Font weight.

color
string"#f5f5f5"

Text color.

interval
number12

Initial frames between switch starts. Also the first-word hold; never shorter than transitionFrames.

acceleration
number0.9

Multiplier for each following interval, clamped to 0.5–1. Lower values accelerate faster; 1 gives constant timing.

transitionFrames
number6

Duration of each upward roll, clamped to at least 1 frame.

  • prefixstring

    Text that stays on the baseline. Its horizontal position follows the changing total width.

    Default"Looking for"

  • textstring

    Words or phrases separated by | or newlines.

    Default"leads | customers | … | conversions"

  • suffixstring

    Appended to every changing word and rolls with it.

    Default"?"

  • fontSizenumber

    Font size in composition pixels. The whole line scales down to fit the longest phrase within 84% of frame width.

    Default60

  • fontFamilystring

    Font family. Load custom font faces in your composition; measurement waits for the selected face.

    Default"Arial, Helvetica, sans-serif"

  • fontWeightnumber

    Font weight.

    Default400

  • colorstring

    Text color.

    Default"#f5f5f5"

  • intervalnumber

    Initial frames between switch starts. Also the first-word hold; never shorter than transitionFrames.

    Default12

  • accelerationnumber

    Multiplier for each following interval, clamped to 0.5–1. Lower values accelerate faster; 1 gives constant timing.

    Default0.9

  • transitionFramesnumber

    Duration of each upward roll, clamped to at least 1 frame.

    Default6

For custom sequences, getInlineWordRollDuration({ text, interval, acceleration, transitionFrames }) returns the number of frames until the last word settles. Add your desired hold when choosing the composition or Sequence duration. A single phrase needs no transition and returns 0.

Widths are measured in unscaled composition pixels after fonts load and again when the text or font changes, preserving layout inside resized Players. The same scale is used for every word, preventing font-size jumps. All movement comes from Remotion frames; seeking directly to a switch reproduces the same layout. No CSS animation clock or WebGL context is required.

Common questions

How do I build a headline in Remotion where the last word rolls through options and speeds up?

Install Inline Word Roll with npx shadcn@latest add @remocn/inline-word-roll, set prefix and pass the words in text, separated by |. acceleration below 1 makes each roll come sooner.

Can it roll at a steady pace?

Yes. Set acceleration={1}.