Caret Collapse

A line of typed text crops down to its blinking caret, which glides over and opens into a prompt screen. A free, MIT-licensed Remotion transition.

Installation
$ pnpm dlx shadcn@latest add @remocn/caret-collapse

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { CaretCollapseDemo } from "@/components/remocn/caret-collapse";
 
const CaretCollapseDemoScene = () => (
  <CaretCollapseDemo
    url="remocn.dev/launch"
    question="What will you launch next?"
    prompt="Make a 30-second launch film for our 2.0 release"
  />
);
 
export const RemotionRoot = () => (
  <Composition
    id="CaretCollapseDemo"
    component={CaretCollapseDemoScene}
    durationInFrames={264}
    fps={60}
    width={1280}
    height={720}
  />
);

Scene A types a URL with a short label after it. The frame crops down to the caret, which blinks off, glides to the prompt position and opens into scene B, a composer with a question heading and a prompt typed in. Pass url, label, question and prompt; it ships light and dark.

The ground is a live gradients.sh shader (GshGround), installed with the component as @remocn/gsh. Pick another look with the ground preset prop.

Props20

PropTypeDefault
theme
"dark" | "light""dark"

Light or dark palette for both scenes

accent
string—

Caret color; defaults to the theme caret

url
string"remocn.dev/launch"

URL typed in scene A

label
string"is live"

Short label shown after the URL

question
string"What will you launch next?"

Heading above the prompt in scene B

prompt
string"Make a 30-second launch film for our 2.0 release"

Text typed into the scene B prompt box

attachmentLabel
string"Brand kit attached"

Second line of the attachment chip in the prompt box.

modeLabel
string"Launch film"

Mode pill under the prompt.

stagger
number2

Frames between words of the scene B heading.

ground
GshPresetId—

Preset id for the scene A gradients.sh shader ground

groundParams
Partial<GradientParams>—

Overrides for the scene A shader parameters

groundB
GshPresetId—

Preset id for the scene B gradients.sh shader ground

groundParamsB
Partial<GradientParams>—

Overrides for the scene B shader parameters

fontFamily
string"Geist"

Typeface for the copy. Load the font in your project first.

ink
string—

Text color; overrides the theme ink.

background
string—

Solid fill in place of the gradient ground; pass "transparent" to drop it.

logo
React.ReactNode—

Replaces the remocn mark.

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"

    Light or dark palette for both scenes

    Default"dark"

  • accentstring

    Caret color; defaults to the theme caret

  • urlstring

    URL typed in scene A

    Default"remocn.dev/launch"

  • labelstring

    Short label shown after the URL

    Default"is live"

  • questionstring

    Heading above the prompt in scene B

    Default"What will you launch next?"

  • promptstring

    Text typed into the scene B prompt box

    Default"Make a 30-second launch film for our 2.0 release"

  • attachmentLabelstring

    Second line of the attachment chip in the prompt box.

    Default"Brand kit attached"

  • modeLabelstring

    Mode pill under the prompt.

    Default"Launch film"

  • staggernumber

    Frames between words of the scene B heading.

    Default2

  • groundGshPresetId

    Preset id for the scene A gradients.sh shader ground

  • groundParamsPartial<GradientParams>

    Overrides for the scene A shader parameters

  • groundBGshPresetId

    Preset id for the scene B gradients.sh shader ground

  • groundParamsBPartial<GradientParams>

    Overrides for the scene B shader parameters

  • fontFamilystring

    Typeface for the copy. Load the font in your project first.

    Default"Geist"

  • inkstring

    Text color; overrides the theme ink.

  • backgroundstring

    Solid fill in place of the gradient ground; pass "transparent" to drop it.

  • logoReact.ReactNode

    Replaces the remocn mark.

  • 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

  • speednumber

    Playback speed multiplier for the whole timeline.

    Default1