Glass Capsule
A glass capsule slides over the focus word of a two-line headline and magnifies it in italic. A free, MIT-licensed Remotion text animation.
$ pnpm dlx shadcn@latest add @remocn/glass-capsuleUsage
// src/Root.tsx
import { Composition } from "remotion";
import { GlassCapsule } from "@/components/remocn/glass-capsule";
const GlassCapsuleScene = () => (
<GlassCapsule lines={["Launch films", "that move."]} focus="move" accent="#3B5BFD" />
);
export const RemotionRoot = () => (
<Composition
id="GlassCapsule"
component={GlassCapsuleScene}
durationInFrames={280}
fps={60}
width={1280}
height={720}
/>
);The two lines rise in, then a glass capsule glides over focus, magnifies it and swaps it to a serif italic while the capsule glows. Pass lines and focus (a word that appears in them); it ships light and dark through theme.
Props12
| Prop | Type | Default |
|---|---|---|
| lines | string[]["Launch films", "that move."] Headline lines, shown top to bottom | |
| focus | string"move" Word the glass capsule magnifies; must appear in lines | |
| magnify | number1.1 How much the capsule magnifies the focus word once it rests. | |
| accent | string"#3B5BFD" Accent color (any valid CSS color) | |
| ink | string— Text color; overrides the theme ink. | |
| background | string— Background fill; pass "transparent" to drop it. | |
| fontFamily | string"Instrument Sans" 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. | |
| speed | number1 Playback speed multiplier | |
| theme | "dark" | "light""dark" Ships light and dark palettes | |
- linesstring[]
Headline lines, shown top to bottom
Default
["Launch films", "that move."] - focusstring
Word the glass capsule magnifies; must appear in lines
Default
"move" - magnifynumber
How much the capsule magnifies the focus word once it rests.
Default
1.1 - accentstring
Accent color (any valid CSS color)
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
"Instrument Sans" - 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 - grainboolean
Film grain over the scene.
Default
true - speednumber
Playback speed multiplier
Default
1 - theme"dark" | "light"
Ships light and dark palettes
Default
"dark"