Flank Roll Swap
Two flanking words roll into new words around a photo placed in the middle of the line. A free, MIT-licensed Remotion text animation.
$ pnpm dlx shadcn@latest add @remocn/flank-roll-swapUsage
// src/Root.tsx
import { Composition } from "remotion";
import { FlankRollSwap } from "@/components/remocn/flank-roll-swap";
const FlankRollSwapScene = () => (
<FlankRollSwap from={["Remocn", "Studio"]} to={["Out now", "on remocn.dev"]} accentWord="remocn.dev" images={["/photos/hero.jpg"]} />
);
export const RemotionRoot = () => (
<Composition
id="FlankRollSwap"
component={FlankRollSwapScene}
durationInFrames={252}
fps={60}
width={1280}
height={720}
/>
);A two-part line sits on either side of an image, then each side rolls letter by letter into the to pair while the pictures cycle. The default photos use staticFile(...) paths that only exist in the Remocn repo, so pass your own URLs in images.
The ground is a live gradients.sh shader (GshGround), installed with the component as @remocn/gsh. Pick another look with the ground preset prop. It ships in light and dark through the theme prop.
Props16
| Prop | Type | Default |
|---|---|---|
| from | [string, string]["Remocn", "Studio"] Left and right words shown first. | |
| to | [string, string]["Out now", "on remocn.dev"] Left and right words they roll into. | |
| accentWord | string"remocn.dev" Word in `to` tinted with the accent color. | |
| images | string[]— Image URLs cycled in the middle; defaults to repo-only files. | |
| swapAt | number48 Frame the left words start to roll; the right side follows 6 frames later. | |
| stagger | number1.2 Frames between letters as a word rolls. | |
| accent | string— Accent color override; falls back to the theme accent. | |
| ink | string— Text color override; falls back to the theme ink. | |
| background | string— Solid fill in place of the gradient ground; pass "transparent" to drop it. | |
| fontFamily | string"Hanken Grotesk" 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. | |
| ground | GshPresetId— Gradient ground preset id for the backdrop. | |
| groundParams | Partial<GradientParams>— Partial gradient parameters that tweak the chosen ground preset. | |
- from[string, string]
Left and right words shown first.
Default
["Remocn", "Studio"] - to[string, string]
Left and right words they roll into.
Default
["Out now", "on remocn.dev"] - accentWordstring
Word in `to` tinted with the accent color.
Default
"remocn.dev" - imagesstring[]
Image URLs cycled in the middle; defaults to repo-only files.
- swapAtnumber
Frame the left words start to roll; the right side follows 6 frames later.
Default
48 - staggernumber
Frames between letters as a word rolls.
Default
1.2 - accentstring
Accent color override; falls back to the theme accent.
- inkstring
Text color override; falls back to the theme ink.
- backgroundstring
Solid fill in place of the gradient ground; pass "transparent" to drop it.
- fontFamilystring
Typeface for the copy. Load the font in your project first.
Default
"Hanken Grotesk" - 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" - groundGshPresetId
Gradient ground preset id for the backdrop.
- groundParamsPartial<GradientParams>
Partial gradient parameters that tweak the chosen ground preset.