Uncomment Line

Code-comment lines lose their comment markers one by one and light up as live copy. A free, MIT-licensed Remotion text animation.

Installation
$ pnpm dlx shadcn@latest add @remocn/uncomment-line

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { UncommentLine } from "@/components/remocn/uncomment-line";
 
const UncommentLineScene = () => (
  <UncommentLine lines={["Fork the scenes.", "Change anything.", "Own the cut."]} marker="// " highlight={-1} />
);
 
export const RemotionRoot = () => (
  <Composition
    id="UncommentLine"
    component={UncommentLineScene}
    durationInFrames={250}
    fps={60}
    width={1280}
    height={720}
  />
);

Lines appear dimmed behind a comment marker, then each marker drops away in turn so the line lights up. Pass lines for the copy and highlight for which line ends accented. It ships in light and dark through the theme prop.

Props13

PropTypeDefault
lines
string[]—

Lines of copy, each revealed in turn.

marker
string"// "

Comment prefix shown before each line until it opens.

highlight
number-1

Index of the accented line; negative counts from the end.

stagger
number13

Frames between one line uncommenting and the next.

dim
number0.28

Opacity of a line while it is still commented out.

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"Geist"

Typeface for the lines; the comment marker stays mono. 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.

  • linesstring[]

    Lines of copy, each revealed in turn.

  • markerstring

    Comment prefix shown before each line until it opens.

    Default"// "

  • highlightnumber

    Index of the accented line; negative counts from the end.

    Default-1

  • staggernumber

    Frames between one line uncommenting and the next.

    Default13

  • dimnumber

    Opacity of a line while it is still commented out.

    Default0.28

  • 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 lines; the comment marker stays mono. 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

  • speednumber

    Playback speed multiplier for the whole timeline.

    Default1

  • theme"dark" | "light"

    Ships light and dark; picks the palette.

    Default"dark"