Pass Swap

An object sweeps across the frame and each pass swaps the headline to the next line. A free, MIT-licensed Remotion text animation.

Installation
$ pnpm dlx shadcn@latest add @remocn/pass-swap

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { PassSwap } from "@/components/remocn/pass-swap";
 
const PassSwapScene = () => (
  <PassSwap lines={["Copy the code.", "Own every frame.", "Ship the film."]} shape="disc" />
);
 
export const RemotionRoot = () => (
  <Composition
    id="PassSwap"
    component={PassSwapScene}
    durationInFrames={300}
    fps={60}
    width={1280}
    height={720}
  />
);

A slab or disc crosses the frame, and every pass replaces the headline with the next entry in lines. Pass lines, and use src with a transparent PNG to sweep your own product cutout instead of the built-in shape. It ships in light and dark through the theme prop.

Props15

PropTypeDefault
lines
string[]—

Headlines in order; each pass of the object swaps to the next one.

shape
"slab" | "disc" | "mixed""mixed"

Object when no `src` is given; "mixed" alternates slab and disc per pass.

src
string—

A product cutout (transparent PNG) to sweep instead of the shape.

accentLastWord
booleantrue

Fill the last word of the final line with the object gradient.

accent
string"#3B5BFD"

Accent color override; falls back to the theme accent.

ink
string—

Text color; overrides the theme ink.

background
string—

Background fill; pass "transparent" to drop it.

fontFamily
string"Hanken Grotesk"

Typeface for the copy. Load the font in your project first.

passLength
number30

Frames one pass of the object takes to cross the frame.

passGap
number46

Frames from the start of one pass to the start of the next.

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.

grain
booleantrue

Film grain over the scene.

theme
"dark" | "light""dark"

Ships light and dark; picks the palette.

speed
number1

Playback speed multiplier for the whole timeline.

  • linesstring[]

    Headlines in order; each pass of the object swaps to the next one.

  • shape"slab" | "disc" | "mixed"

    Object when no `src` is given; "mixed" alternates slab and disc per pass.

    Default"mixed"

  • srcstring

    A product cutout (transparent PNG) to sweep instead of the shape.

  • accentLastWordboolean

    Fill the last word of the final line with the object gradient.

    Defaulttrue

  • accentstring

    Accent color override; falls back to the theme accent.

    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"Hanken Grotesk"

  • passLengthnumber

    Frames one pass of the object takes to cross the frame.

    Default30

  • passGapnumber

    Frames from the start of one pass to the start of the next.

    Default46

  • 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

  • grainboolean

    Film grain over the scene.

    Defaulttrue

  • theme"dark" | "light"

    Ships light and dark; picks the palette.

    Default"dark"

  • speednumber

    Playback speed multiplier for the whole timeline.

    Default1