Rolodex Flip
One word inside a held line flips through a list of names like a 3D rolodex card while the rest of the line stays still, for install commands, works-with beats and plan names. A free, MIT-licensed Remotion text animation.
In Remotion, Rolodex Flip flips one word inside a held line through a list of names like a 3D rolodex card: the current value tips up and away, the next one turns in from below, and the rest of the line never moves. Use it for an install command that cycles component names, a works-with-X beat or plan names.
$ pnpm dlx shadcn@latest add @remocn/rolodex-flipHow to flip a word through names like a 3D rolodex in Remotion
One word of a sentence turning over through several names, like cards on a rolodex, is one component. Install it and put it inside your line:
npx shadcn@latest add @remocn/rolodex-flip- The 3D flip is plain CSS:
perspective: 420pxon the wrapper androtateXon each value, driven byinterpolate(). A value turns in from -85° with a 20 px drop and turns out to 85°. No three.js,@remotion/threeor React Three Fiber. - Easing is
Easing.out(Easing.cubic)for the value turning in andEasing.in(Easing.cubic)for the one turning out. Perspective and easing are not props: change them in the copied file. from,intervalandflipDurationset when the first flip starts, how long each value holds and how long a flip takes, in 30 fps frames.- A hidden copy of the longest value holds the width and baseline of the slot, so the line never reflows. You don't need
measureTextor@remotion/layout-utils. - It loads no font: the word inherits the font of the text around it.
For numbers with a counting story use Number Wheel or Rolling Number.
Good to know
- Length: the last flip ends at
from + (items.length - 2) * interval + 1.5 * flipDurationframes at 30 fps, which is 75 frames for the five default values (150 at 60 fps). The last value then stays for the rest of theSequence. The props counted in frames stay in 30 fps frames at any frame rate, see Frame rate. - Installs:
remotionfrom npm, plus the remocn helpersglide,frame-rateandtimeline. No other npm dependencies. The shadcn CLI copies the source into your project. - The
timingprop moves, trims or stretches single flips by id (flip:1,flip:2, ...).
Usage
RolodexFlip renders an inline span and inherits the surrounding typography — drop it into the middle of a line and it flips through items while the rest of the line stays perfectly still: the outgoing value tips up and away, the incoming one turns in from below half a flip later, and an invisible sizer holds the width and baseline of the longest value. The first value is visible from the start and the last one stays for the rest of the scene.
import { RolodexFlip } from "@/components/remocn/rolodex-flip";
export const MyScene = () => (
<span style={{ fontFamily: "monospace", fontSize: 36 }}>
$ npx shadcn add{" "}
<RolodexFlip items={["button", "dialog", "command", "tabs", "chart-area"]} />
</span>
);Sizing
The sizer uses the longest item by character count as real hidden text, so it works in any font. In a proportional font two equal-length strings can differ in width, so if your values are the same length put the visually widest one last — or anywhere, it just needs to be in the list.
slot-machine-roll and number-wheel are numeric reels, per-word-crossfade is a flat opacity swap, and value-swap slides values vertically at explicit frames — reach for RolodexFlip when arbitrary strings should cycle with physical depth at a fixed width.
Props6
| Prop | Type | Default |
|---|---|---|
| items | string[]— Values shown in order. The last one stays. | |
| from | number0 Frame of the first flip. | |
| interval | number20 Frames each value holds before flipping. | |
| flipDuration | number10 Length of the flip itself in frames. | |
| className | string— Passed to the wrapper span. | |
| style | CSSProperties— Merged onto the wrapper span. | |
- itemsstring[]
Values shown in order. The last one stays.
Default
— - fromnumber
Frame of the first flip.
Default
0 - intervalnumber
Frames each value holds before flipping.
Default
20 - flipDurationnumber
Length of the flip itself in frames.
Default
10 - classNamestring
Passed to the wrapper span.
Default
— - styleCSSProperties
Merged onto the wrapper span.
Default
—