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.
$ pnpm dlx shadcn@latest add @remocn/uncomment-lineHow 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:
npx shadcn@latest add @remocn/uncomment-lineThe 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,Sequencelengths) 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-fontsfrom npm, plus the remocn helpersglide,frame-rate,timeline. The shadcn CLI copies the source into your project. - Font: loads Geist and Geist Mono itself through
@remotion/google-fonts. PassfontFamilyto use your own face, and load that font in your project.
Usage
// 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
| Prop | Type | Default |
|---|---|---|
| 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.
Default
13 - dimnumber
Opacity of a line while it is still commented out.
Default
0.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.
Default
1 - delaynumber
Frames to hold the first frame before anything moves.
Default
0 - speednumber
Playback speed multiplier for the whole timeline.
Default
1 - 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.
Related effects
- What Sticks: the same stepped reveal without code syntax.
- Diff Swap: one line edited into another.
- Typewriter: typed characters instead of a reveal.