Uncomment Line

Commented-out code lines lose their // markers one at a time and light up as live copy, the last line in an accent color. A free, MIT-licensed Remotion text animation.

In Remotion, Uncomment Line shows lines of code comments losing their // markers one by one and lighting up as live copy. Use it in a developer-focused video where promises should read like code being switched on.

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

How to build this in Remotion

You don't need Code Hike, Shiki Magic Move or a syntax highlighter. Install the component and pass the lines:

bash
npx shadcn@latest add @remocn/uncomment-line

The lines rise in dimmed to dim opacity (0.28) behind a monospace comment marker. From frame 34, every stagger frames (13) one marker slides away and fades and its line lights up to full opacity. The highlight line ends in the accent color: pink by default (#F472B6 dark, #C2185B light), or your accent. The schedule lives in timeline.ts.

Good to know

  • Length: 74 frames of motion at 30 fps (148 at 60 fps) with the default props. That is the minimum for its Sequence; add your own hold on top. The Usage example below is a 60 fps composition, so the numbers it hands to Remotion (durationInFrames, Sequence lengths) are doubled. The component's own props counted in frames stay in 30 fps frames at any frame rate, 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 Geist and Geist Mono itself through @remotion/google-fonts. Pass fontFamily to use your own face, and load that font in your project.

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"

Common questions

How do I animate commented-out code lines being uncommented one at a time?

Install Uncomment Line with npx shadcn@latest add @remocn/uncomment-line and pass lines. Each line drops its comment marker in turn and lights up.

Can I use # or -- instead of //?

Yes. Pass any prefix as marker, for example marker="# ".

Is it a syntax-highlighted code block?

No. The lines are copy set in Geist with a Geist Mono comment marker; there is no syntax highlighting.

  • What Sticks: the same stepped reveal without code syntax.
  • Diff Swap: one line edited into another.
  • Typewriter: typed characters instead of a reveal.