Crosshair Lock

A crosshair locks onto the peak of a dot plot and calls out 2.4k per minute. A free, MIT-licensed Remotion number animation.

Installation
$ pnpm dlx shadcn@latest add @remocn/crosshair-lock

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { CrosshairLock } from "@/components/remocn/crosshair-lock";
 
const CrosshairLockScene = () => (
  <CrosshairLock x={0.7} y={0.94} label="Peak" value="2.4k/min" />
);
 
export const RemotionRoot = () => (
  <Composition
    id="CrosshairLock"
    component={CrosshairLockScene}
    durationInFrames={240}
    fps={60}
    width={1280}
    height={720}
  />
);

Two crosshair lines slide across a dot plot and lock onto a point with a ring, then a leader line pops out a label and value. Set the target with x and y (0 to 1 across the plot) and the callout with label and value. Ships dark and light via theme.

Props15

PropTypeDefault
x
number0.7

Horizontal position of the locked point, from 0 to 1.

y
number0.94

Vertical position of the locked point, from 0 to 1.

label
string"Peak"

Small name above the callout value.

value
string"2.4k/min"

The callout text, such as 2.4k/min.

fontWeight
number500

Weight of the callout value.

slide
number26

Frames the crosshair takes to glide onto the peak.

accent
string"#3B5BFD"

Accent color for the hero element.

ink
string—

Text color; overrides the theme ink.

background
string—

Background fill; pass "transparent" to drop it.

fontFamily
string"Space Grotesk"

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

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.

grain
booleantrue

Film grain over the scene.

theme
"dark" | "light""dark"

Dark or light palette.

speed
number1

Playback multiplier.

  • xnumber

    Horizontal position of the locked point, from 0 to 1.

    Default0.7

  • ynumber

    Vertical position of the locked point, from 0 to 1.

    Default0.94

  • labelstring

    Small name above the callout value.

    Default"Peak"

  • valuestring

    The callout text, such as 2.4k/min.

    Default"2.4k/min"

  • fontWeightnumber

    Weight of the callout value.

    Default500

  • slidenumber

    Frames the crosshair takes to glide onto the peak.

    Default26

  • accentstring

    Accent color for the hero element.

    Default"#3B5BFD"

  • inkstring

    Text color; overrides the theme ink.

  • backgroundstring

    Background fill; pass "transparent" to drop it.

  • fontFamilystring

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

    Default"Space Grotesk"

  • 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

  • grainboolean

    Film grain over the scene.

    Defaulttrue

  • theme"dark" | "light"

    Dark or light palette.

    Default"dark"

  • speednumber

    Playback multiplier.

    Default1