Glyph Relay
Setup-and-twist text for Remotion: a phrase like Building a product hands off between lines until a giant question mark resolves into Launching it?
In Remotion, Glyph Relay hands a phrase such as "Building a product" off between lines, piece by piece, until a giant question mark resolves into the twist, "Launching it?". Use it for a setup-and-twist story beat or a rhetorical question that turns into the pitch.
$ pnpm dlx shadcn@latest add @remocn/glyph-relayHow to build this in Remotion
You don't need a TransitionSeries of three slides. Install the component and write the three lines:
npx shadcn@latest add @remocn/glyph-relayIt is one scene: the hand-offs, the question mark's growth and its drop run on spring() and interpolate() with timings from timeline.ts, and colors change with interpolateColors(). The ground is a live gradients.sh shader (GshGround), installed with the component as @remocn/gsh. It doesn't need fitText() or measureText() from @remotion/layout-utils.
Good to know
- Length: 114 frames of motion at 30 fps (228 at 60 fps) with the default props. The demo plays 146 frames, which adds a hold: frames past the end of the motion hold the final frame. The Usage example below is a 60 fps composition, so the numbers it hands to Remotion are doubled, see Frame rate.
- Installs:
remotion,@remotion/google-fontsfrom npm, plus the remocn helpersgsh,glide,frame-rate,timeline. The shadcn CLI copies the source into your project. - Fonts: loads Onest and Instrument Serif italic itself through
@remotion/google-fonts. PassfontFamilyto use your own face, and load that font in your project. - The story has three parts:
line1andline2are each a pair of text parts (defaults["Building a", "product"]and["is", "easy."]), andline3is the twist. The middle line is part of the hand-off, so write one for your story. - Pass
background(a color or"transparent") to replace the shader ground with a solid fill.
Usage
// src/Root.tsx
import { Composition } from "remotion";
import { GlyphRelay } from "@/components/remocn/glyph-relay";
const GlyphRelayScene = () => (
<GlyphRelay line1={["Building a", "product"]} line2={["is", "easy."]} line3="Launching it?" />
);
export const RemotionRoot = () => (
<Composition
id="GlyphRelay"
component={GlyphRelayScene}
durationInFrames={292}
fps={60}
width={1280}
height={720}
/>
);A phrase is handed off glyph by glyph between lines until a giant question mark resolves into the final line. Pass line1, line2 (each a pair of text parts) and line3; it ships light and dark, over a gradient ground you can change with ground.
The ground is a live gradients.sh shader (GshGround), installed with the component as @remocn/gsh. Pick another look with the ground preset prop.
Props15
| Prop | Type | Default |
|---|---|---|
| theme | "dark" | "light""dark" Colour scheme; ships light and dark. | |
| accent | string"#3B5BFD" Accent colour (any CSS colour). | |
| line1 | [string, string]["Building a", "product"] First line as a pair of text parts. | |
| line2 | [string, string]["is", "easy."] Second line as a pair of text parts. | |
| line3 | string"Launching it?" Final line the question mark resolves into. | |
| push | number0.045 How far the scene pushes in over its length, as a share of its size. | |
| ink | string— Text color; overrides the theme ink. | |
| background | string— Solid fill in place of the gradient ground; pass "transparent" to drop it. | |
| fontFamily | string"Onest" Typeface for the copy. Onest loads by default; load any other face in your project first. | |
| 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. | |
| ground | GshPresetId— Gradient preset used for the backdrop. | |
| groundParams | Partial<GradientParams>— Overrides for the gradient preset parameters. | |
- theme"dark" | "light"
Colour scheme; ships light and dark.
Default
"dark" - accentstring
Accent colour (any CSS colour).
Default
"#3B5BFD" - line1[string, string]
First line as a pair of text parts.
Default
["Building a", "product"] - line2[string, string]
Second line as a pair of text parts.
Default
["is", "easy."] - line3string
Final line the question mark resolves into.
Default
"Launching it?" - pushnumber
How far the scene pushes in over its length, as a share of its size.
Default
0.045 - inkstring
Text color; overrides the theme ink.
- backgroundstring
Solid fill in place of the gradient ground; pass "transparent" to drop it.
- fontFamilystring
Typeface for the copy. Onest loads by default; load any other face in your project first.
Default
"Onest" - logoReact.ReactNode
Replaces the remocn mark.
- scalenumber
Size of the foreground around the frame's center; the background stays put.
Default
1 - delaynumber
Frames to hold the first frame before anything moves.
Default
0 - speednumber
Playback speed multiplier for the whole timeline.
Default
1 - groundGshPresetId
Gradient preset used for the backdrop.
- groundParamsPartial<GradientParams>
Overrides for the gradient preset parameters.
Common questions
How do I animate a phrase handing off between lines until a giant question mark resolves into the twist?
Install Glyph Relay with npx shadcn@latest add @remocn/glyph-relay and pass line1, line2 and line3, for example "Building a product", "is easy." and "Launching it?".
Can I drop the shader background?
Yes. Pass background with a solid color, or "transparent" to composite it over your own layer.
How long should it run?
At least 114 frames at 30 fps (228 at 60 fps). The demo uses 146 for a hold on the last line.
Related effects
- Hook Uncurl: a simple question-and-answer swap in stacked caps.
- Slide Doors: a straight sequence of three lines.
- Answer First: the answer lands before the question.