Cursor Frame
Design-tool text animation for Remotion: a selection box with corner handles and a width/height badge is dragged and resized around a headline so it rewraps.
In Remotion, Cursor Frame makes a scene look like a design tool: a mouse cursor drags a selection box with corner handles and a width/height badge around a headline, then resizes it so the text rewraps onto two lines. Use it in a product video about layout, editing or a design tool, where the headline should respond to the frame live.
$ pnpm dlx shadcn@latest add @remocn/cursor-frameHow to build this in Remotion
You don't need to rebuild it with fillTextBox or fitText from @remotion/layout-utils plus keyframed interpolate() calls. Install the component and pass your headline:
npx shadcn@latest add @remocn/cursor-frameIt is one scene driven by a schedule in timeline.ts: the cursor press, drag and resize, and the frame clearing each get a start frame, and the motion runs on interpolate() with Easing.bezier curves. The words are measured in the DOM before the first frame (held with delayRender), so each word can glide to its new line when the box narrows instead of the paragraph jumping.
Good to know
- Length: 184 frames of motion at 30 fps (368 at 60 fps) with the default props. That is the minimum for its
Sequence; add your own hold on top (the demo plays 230 frames). The Usage example below is a 60 fps composition, so the numbers it hands to Remotion are doubled, see Frame rate. - The drag path, the target box sizes and the wrap are fixed in the scene: the headline always rewraps once, onto two lines. To change the path, edit the copied file.
showCursor={false}hides the mouse pointer and keeps the frame, handles and badge.- 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 { CursorFrame } from "@/components/remocn/cursor-frame";
const CursorFrameScene = () => (
<CursorFrame title="Launch videos, in code." theme="light" accent="#3B5BFD" />
);
export const RemotionRoot = () => (
<Composition
id="CursorFrame"
component={CursorFrameScene}
durationInFrames={460}
fps={60}
width={1280}
height={720}
/>
);Words fade in, a cursor presses and drags a selection frame over them, then resizes it so the headline rewraps onto two lines before the frame clears. Pass title for the headline; it ships light and dark through theme and defaults to light.
Props11
| Prop | Type | Default |
|---|---|---|
| title | string"Launch videos, in code." Headline that gets selected and rewrapped | |
| accent | string"#3B5BFD" Accent color (any valid CSS color) | |
| ink | string— Text color; overrides the theme ink. | |
| background | string— Background fill; pass "transparent" to drop it. | |
| fontFamily | string"Geist" Typeface for the copy. The default is loaded for you; load any other font in your project first. | |
| fontWeight | number400 Weight of the title. | |
| showCursor | booleantrue Draws the mouse cursor that drags the frame. | |
| 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. | |
| theme | "dark" | "light""light" Ships light and dark palettes | |
| speed | number1 Playback speed multiplier | |
- titlestring
Headline that gets selected and rewrapped
Default
"Launch videos, in code." - accentstring
Accent color (any valid CSS color)
Default
"#3B5BFD" - inkstring
Text color; overrides the theme ink.
- backgroundstring
Background fill; pass "transparent" to drop it.
- fontFamilystring
Typeface for the copy. The default is loaded for you; load any other font in your project first.
Default
"Geist" - fontWeightnumber
Weight of the title.
Default
400 - showCursorboolean
Draws the mouse cursor that drags the frame.
Default
true - 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 - theme"dark" | "light"
Ships light and dark palettes
Default
"light" - speednumber
Playback speed multiplier
Default
1
Common questions
How do I make a Remotion scene that looks like a design tool, with a selection box resized around a headline?
Install Cursor Frame with npx shadcn@latest add @remocn/cursor-frame and pass title. The cursor drags and resizes the box, the badge counts the size, and the headline rewraps.
Can I set the box sizes or the drag path with props?
No. They are constants in the copied file; accent colors the frame, handles and badge.
Related effects
- Staggered Fade Up: words slide up and fade in sequentially with a wave-like cascade.
- Typewriter: character-by-character text reveal with a deterministic blinking cursor.
- Marker Highlight: a colored marker block draws behind a phrase while the text color shifts.
- Selection Snap: a thin word in a loose viewfinder snaps into a design-tool selection while it goes from Thin to Black, pops its handles and counts up a size badge.