Skip to content

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

3.6 KB
Raw Blame
---
title: Terminal Cursor Zoom
description: Camera locked to the typing cursor, dollying across a terminal as a command types at high zoom
component: terminal-cursor-zoom
vibe: tech
length: 90
useWhen:
  - "One install command is the whole beat and it must stay legible in a vertical or small-screen crop — the camera holds the cursor at frame center at 2.8× zoom."
  - "A short social clip needs kinetic energy from the typing itself rather than from a full terminal session."
  - "An install or CTA card should end on the command still under the cursor, with no output lines to distract from it."
avoidWhen:
  - "The session has multiple lines, logs, or success output — use `terminal-simulator`; this component types exactly one command line and the camera never leaves it."
  - "The terminal window should stay statically framed — use `terminal-simulator` on its own, since this is only a camera rig around it."
  - "The content is source code in an editor rather than a shell command — use `glass-code-walk` for the same tracking camera over a code panel."
askedAs:
  - "zoomed terminal typing one command"
  - "camera on the terminal cursor"
  - "I want a close-up on a command line typing a single install command"
  - "dolly along a typed shell command at high zoom"
  - "hero shot of npx or npm command being typed"
  - "developer CTA showing the one command to get started in tight focus"
---

<ComponentPreview name="terminal-cursor-zoom" />

<InstallBlock name="terminal-cursor-zoom" />

## Usage

```tsx
// src/Root.tsx
import { Composition } from "remotion";
import { TerminalCursorZoom } from "@/components/remocn/terminal-cursor-zoom";

const TerminalCursorZoomScene = () => (
  <TerminalCursorZoom command="npx shadcn add @remocn/terminal-simulator" />
);

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

The camera reads `terminal-simulator`'s fixed layout to keep the cursor pinned, so it pairs with that component — `npx shadcn add @remocn/terminal-cursor-zoom` pulls it in automatically.

<PropsTable title="Props"
  rows={[
    {
      name: "command",
      type: "string",
      default: "\"npx shadcn add @remocn/terminal-cursor-zoom\"",
      description: "The single command line typed out and tracked by the camera",
    },
    {
      name: "zoom",
      type: "number",
      default: "2.8",
      description: "Camera scale while the cursor is pinned to screen center",
    },
    {
      name: "fontSize",
      type: "number",
      default: "20",
      description: "Monospace font size in pixels; the cursor geometry is derived from it",
    },
    {
      name: "prompt",
      type: "string",
      default: "\"$\"",
      description: "Prompt prefix shown before the command",
    },
    {
      name: "title",
      type: "string",
      default: "\"~/code/remocn-demo\"",
      description: "Title shown in the terminal window chrome",
    },
    {
      name: "charsPerFrame",
      type: "number",
      default: "1",
      description: "Typing speed passed through to the terminal; the camera mirrors it exactly",
    },
    {
      name: "chunkSize",
      type: "number",
      default: "1",
      description: "Characters revealed per step; the camera snaps to the same chunking",
    },
    {
      name: "speed",
      type: "number",
      default: "1",
      description: "Playback multiplier applied to both the typing and the camera",
    },
    {
      name: "className",
      type: "string",
      description: "Optional className passed to the outer container",
    },
  ]}
/>