Turnabout

One sentence turns into its mirror image as words flip, ending with an accent-colored phrase. A free, MIT-licensed Remotion text animation.

Installation
$ pnpm dlx shadcn@latest add @remocn/turnabout

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { Turnabout } from "@/components/remocn/turnabout";
 
const TurnaboutScene = () => (
  <Turnabout before="You work for the video." after="The video works for you." highlight="you." />
);
 
export const RemotionRoot = () => (
  <Composition
    id="Turnabout"
    component={TurnaboutScene}
    durationInFrames={300}
    fps={60}
    width={1280}
    height={720}
  />
);

The before sentence enters word by word, then turns into the after sentence while shared words travel to their new spots. The highlight phrase in after lights up in the accent color. It ships in light and dark through the theme prop.

Props13

PropTypeDefault
before
string"You work for the video."

Opening sentence.

after
string"The video works for you."

Sentence it turns into.

highlight
string"you."

Phrase inside `after` lit in the accent color.

stagger
number3

Frames between words of the first line rising in.

fontWeight
number500

Weight of the lines.

accent
string—

Accent color override; falls back to the theme accent.

ink
string—

Text color; overrides the theme ink.

background
string—

Background color override; falls back to the theme background.

fontFamily
string"DM Sans"

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.

speed
number1

Playback speed multiplier for the whole timeline.

theme
"dark" | "light""dark"

Ships light and dark; picks the palette.

  • beforestring

    Opening sentence.

    Default"You work for the video."

  • afterstring

    Sentence it turns into.

    Default"The video works for you."

  • highlightstring

    Phrase inside `after` lit in the accent color.

    Default"you."

  • staggernumber

    Frames between words of the first line rising in.

    Default3

  • fontWeightnumber

    Weight of the lines.

    Default500

  • accentstring

    Accent color override; falls back to the theme accent.

  • inkstring

    Text color; overrides the theme ink.

  • backgroundstring

    Background color override; falls back to the theme background.

  • fontFamilystring

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

    Default"DM Sans"

  • 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 speed multiplier for the whole timeline.

    Default1

  • theme"dark" | "light"

    Ships light and dark; picks the palette.

    Default"dark"