Selection Snap

A single word snaps into a design-tool selection box with handles, like a layer in Figma: it starts thin in a loose frame, gets bolder from Thin to Black, pops its resize handles and counts up a size badge. A free, MIT-licensed Remotion text animation.

In Remotion, Selection Snap makes a single word look like it is being designed: it starts thin in a loose frame, snaps into a selection box with handles, gets bolder and a W × H size badge counts up. Use it for a design tool, component library or typography feature beat.

Installation
$ pnpm dlx shadcn@latest add @remocn/selection-snap

How to animate a word snapping into a design selection box in Remotion

A word that starts thin inside loose corner brackets, snaps into a selection box with resize handles, turns bold and shows a counting size number is one component. You don't need fitText from @remotion/layout-utils or your own count-up interpolate(). Install it and pass your word:

bash
npx shadcn@latest add @remocn/selection-snap
  • The frame snaps tight with a small overshoot while the weight runs from fromWeight to toWeight (Thin to Black by default) and the color turns to accent.
  • The bracket arms close into a one-pixel box in selectionColor, the eight handles pop in corners first, and the badge counts up to the box size.
  • The weight glides because Inter is a variable font and the component drives font-variation-settings; with a static font it steps through the weights you load.
  • It paints no background and centers the word in its parent. One short word reads best.

If the word should enter with physical motion instead, use Stretch In.

Good to know

  • Length: 38 frames of motion at 30 fps (76 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 with a hold, so its durationInFrames is longer than twice the motion. The component's own props counted in frames stay in 30 fps frames at any frame rate, see Frame rate.
  • Installs: remotion, @remotion/google-fonts from npm, plus the remocn helpers glide, frame-rate, timeline. The shadcn CLI copies the source into your project; nothing else is needed at runtime.
  • Font: loads Inter (variable) 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 { AbsoluteFill, Composition } from "remotion";
import { SelectionSnap } from "@/components/remocn/selection-snap";
 
const Title = () => (
  <AbsoluteFill style={{ backgroundColor: "#0a0a0a" }}>
    <SelectionSnap text="Frame" accent="#ff4d1a" selectionColor="#3d5afe" />
  </AbsoluteFill>
);
 
export const RemotionRoot = () => (
  <Composition
    id="SelectionSnap"
    component={Title}
    durationInFrames={150}
    fps={60}
    width={1280}
    height={720}
  />
);

The word starts at fromWeight inside four corner brackets. Around frame 14 the frame snaps tight with a small overshoot while the weight runs to toWeight and the color turns to accent. The bracket arms grow along the edges until they close into a one-pixel box, the eight handles pop in corners first, and the badge counts up to the snapped box size in reference px.

The weight is continuous because Inter from @remotion/google-fonts is one variable file: the component drives font-variation-settings. The box is a wrapper around the text, so it follows the word as it widens. With a static fontFamily the weight steps through the faces you load instead of gliding.

The component paints no background and centers the word in its parent. Sizes are reference px at a 720px-tall composition and scale with height / 720.

Props10

PropTypeDefault
text
string"Frame"

The word inside the selection. One short word reads best

fontSize
number150

Font size in reference px at 720p

fontFamily
stringInter

Font family. Use a variable font for a continuous weight change

fromWeight / toWeight
number100 / 900

Weight before and after the snap

color
string"#fafafa"

Text color before the snap

accent
string"#D97757"

Text color after the snap

selectionColor
string"#0d99ff"

Brackets, box, handle borders and badge

badge
booleantrue

Show the W × H badge under the box

speed
number1

Timeline speed multiplier

className
string—

Optional className passed to the wrapper

  • textstring

    The word inside the selection. One short word reads best

    Default"Frame"

  • fontSizenumber

    Font size in reference px at 720p

    Default150

  • fontFamilystring

    Font family. Use a variable font for a continuous weight change

    DefaultInter

  • fromWeight / toWeightnumber

    Weight before and after the snap

    Default100 / 900

  • colorstring

    Text color before the snap

    Default"#fafafa"

  • accentstring

    Text color after the snap

    Default"#D97757"

  • selectionColorstring

    Brackets, box, handle borders and badge

    Default"#0d99ff"

  • badgeboolean

    Show the W × H badge under the box

    Defaulttrue

  • speednumber

    Timeline speed multiplier

    Default1

  • classNamestring

    Optional className passed to the wrapper