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.

Installation
$ pnpm dlx shadcn@latest add @remocn/cursor-frame

How 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:

bash
npx shadcn@latest add @remocn/cursor-frame

It 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-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 { 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

PropTypeDefault
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.

    Default400

  • showCursorboolean

    Draws the mouse cursor that drags the frame.

    Defaulttrue

  • 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

  • theme"dark" | "light"

    Ships light and dark palettes

    Default"light"

  • speednumber

    Playback speed multiplier

    Default1

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.

  • 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.