Glass Lens

A glass lens drop magnifies a headline word, glides to a clip and flattens into a call-to-action pill. A free, MIT-licensed Remotion effect.

Installation
$ pnpm dlx shadcn@latest add @remocn/glass-lens

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { GlassLens } from "@/components/remocn/glass-lens";
 
const GlassLensScene = () => (
  <GlassLens
    lines={["Every frame,", "composed."]}
    focus={{ line: 0, word: 1 }}
    cta="Start building"
    src="/images/product.png"
  />
);
 
export const RemotionRoot = () => (
  <Composition
    id="GlassLens"
    component={GlassLensScene}
    durationInFrames={420}
    fps={60}
    width={1280}
    height={720}
  />
);

Headline lines rise in on the left and a glass drop slides in, settling on the focus word to magnify it. The drop then glides to the highlighted clip in the product pane, travels down to the call-to-action slot, flattens into a pill and fills with the accent, and the cta label and arrow land at frame 180. Pass lines, cta and your own src or children for the pane; it ships light and dark.

Props18

PropTypeDefault
lines
string[]["Every frame,", "composed."]

Headline lines, set large on the left

italicLast
booleantrue

Set the last headline line in italic

focus
{ line: number; word: number }{ line: 0, word: 1 }

Line and word index the lens stops on first

cta
string"Start with remocn"

Label inside the pill the lens becomes

previewTitle
string"Launch day."

Title inside the placeholder product pane's preview.

logo
React.ReactNode—

Replaces the Remocn logo above the headline

src
string—

Screenshot for the product pane

children
React.ReactNode—

Custom product pane content; wins over src

accent
string"#3B5BFD"

Accent color of the pill and highlights

ink
string—

Text color; overrides the theme ink.

background
string—

Background fill; pass "transparent" to drop it.

fontFamily
string"Newsreader"

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

magnify
number1

How strongly the glass magnifies what's under it; 0 for flat glass.

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.

speed
number1

Playback multiplier for the whole timeline

theme
"dark" | "light""dark"

Light or dark palette

  • linesstring[]

    Headline lines, set large on the left

    Default["Every frame,", "composed."]

  • italicLastboolean

    Set the last headline line in italic

    Defaulttrue

  • focus{ line: number; word: number }

    Line and word index the lens stops on first

    Default{ line: 0, word: 1 }

  • ctastring

    Label inside the pill the lens becomes

    Default"Start with remocn"

  • previewTitlestring

    Title inside the placeholder product pane's preview.

    Default"Launch day."

  • logoReact.ReactNode

    Replaces the Remocn logo above the headline

  • srcstring

    Screenshot for the product pane

  • childrenReact.ReactNode

    Custom product pane content; wins over src

  • accentstring

    Accent color of the pill and highlights

    Default"#3B5BFD"

  • inkstring

    Text color; overrides the theme ink.

  • backgroundstring

    Background fill; pass "transparent" to drop it.

  • fontFamilystring

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

    Default"Newsreader"

  • magnifynumber

    How strongly the glass magnifies what's under it; 0 for flat glass.

    Default1

  • 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

  • speednumber

    Playback multiplier for the whole timeline

    Default1

  • theme"dark" | "light"

    Light or dark palette

    Default"dark"