Skip to content

Production-ready animations, transitions, backgrounds, and scenes for Remotion

3.7 KB
Raw Blame
---
title: Caret Dolly
description: "A prompt box types a request while the camera dollies along the caret and punches in on one phrase."
component: caret-dolly
vibe: tech
length: 120
useWhen:
  - "An AI product launch where the typed prompt is the hero, with one phrase emphasized in extreme close-up."
  - "You want the camera to feel like it rides the typing caret across a long sentence."
  - "A single request needs to build tension before a send press."
avoidWhen:
  - "The prompt box should sit still with a slash command and an attachment tile — use `card-push-line`, the same prompt card with a push-in instead of a caret dolly."
  - "The text lives in a terminal rather than a prompt card — use `terminal-cursor-zoom`."
  - "A plain headline should type with no UI around it — use `typewriter`."
askedAs:
  - "camera following the text cursor"
  - "typing prompt with camera tracking"
  - "I want the camera to slide along the cursor while a request is typed"
  - "zoom into one phrase of a prompt as it is written"
  - "focus the viewer on the exact words typed into a prompt box"
  - "cinematic prompt typing where the frame travels with the blinking line"
---

<ComponentPreview name="caret-dolly" />

<InstallBlock name="caret-dolly" />

## Usage

```tsx
// src/Root.tsx
import { Composition } from "remotion";
import { CaretDolly } from "@/components/remocn/caret-dolly";

const CaretDollyScene = () => (
  <CaretDolly
    prompt="Make a launch video for our new app with a bold title and a calm ending"
    focus="launch video"
    modelLabel="Remocn 1"
  />
);

export const RemotionRoot = () => (
  <Composition
    id="CaretDolly"
    component={CaretDollyScene}
    durationInFrames={150}
    fps={30}
    width={1280}
    height={720}
  />
);
```

The camera rides the caret as the `prompt` types, then punches in huge on the `focus` phrase, pulls back to show the full box and types the rest. A cursor then presses the send button. Pass your own `prompt` and a `focus` phrase that occurs inside it; it ships light and dark through `theme`.

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

<PropsTable title="Props"
  rows={[
    {
      name: "prompt",
      type: "string",
      default: "\"Make a launch video for our new app with a bold title, product shots and a calm ending\"",
      description: "Full sentence typed into the prompt box.",
    },
    {
      name: "focus",
      type: "string",
      default: "\"launch video\"",
      description: "Phrase inside the prompt that gets the giant close-up.",
    },
    {
      name: "chipLabel",
      type: "string",
      default: "\"Video\"",
      description: "Label of the chip in the box toolbar.",
    },
    {
      name: "modelLabel",
      type: "string",
      default: "\"Remocn 1\"",
      description: "Label of the model selector in the box toolbar.",
    },
    {
      name: "accent",
      type: "string",
      description: "Accent color. Defaults depend on theme.",
    },
    {
      name: "ink",
      type: "string",
      description: "Text color override.",
    },
    {
      name: "background",
      type: "string",
      description: "Background color override for the stage.",
    },
    {
      name: "theme",
      type: "\"dark\" | \"light\"",
      default: "\"dark\"",
      description: "Color scheme. Ships light and dark.",
    },
    {
      name: "ground",
      type: "GshPresetId",
      description: "Shader preset id for the animated background.",
    },
    {
      name: "groundParams",
      type: "Partial<GradientParams>",
      description: "Partial shader parameters that override the ground preset.",
    },
  ]}
/>