Glass Capsule
Liquid glass magnifier for Remotion: a glass capsule slides over one key word in a two-line headline, magnifies it and turns it serif italic. For premium titles.
In Remotion, Glass Capsule slides a glass capsule over one key word in a two-line headline, magnifies that word and switches it to a serif italic. Use it for a premium title or launch line where one word carries the point.
$ pnpm dlx shadcn@latest add @remocn/glass-capsuleHow to build this in Remotion
You don't need backdrop-filter or a hand-made SVG displacement filter. Install the component and name the word:
npx shadcn@latest add @remocn/glass-capsuleThe lens is an SVG filter built into the component: feDisplacementMap bends the word under the capsule, so it renders the same in the preview and in npx remotion render. The lines rise and the capsule glides with interpolate() and Easing, and the text is measured on a canvas while delayRender() holds the first frame. It doesn't need fitText() or measureText() from @remotion/layout-utils.
Good to know
- Length: 94 frames of motion at 30 fps (188 at 60 fps) with the default props. The demo plays 140 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 helpersglide,frame-rate,timeline. The shadcn CLI copies the source into your project. - Fonts: loads Instrument Sans (the lines) and Instrument Serif italic (the magnified word) itself through
@remotion/google-fonts.fontFamilychanges the lines only; the focus word always switches to Instrument Serif italic, so swap thatloadFontcall in the copied file for another italic face. focushas to be a word that appears inlines.magnify(default1.1) sets how much the capsule enlarges it.
Usage
// 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. Instrument Sans loads by default; load any other face 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. Instrument Sans loads by default; load any other face 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"
Common questions
How can I slide a glass capsule over one word in Remotion so it magnifies it and switches it to italic?
Install Glass Capsule with npx shadcn@latest add @remocn/glass-capsule, pass two lines and the focus word. The capsule glides over it, magnifies it and swaps it to a serif italic.
Can I change the italic font?
Not with a prop. The italic is Instrument Serif, loaded in the copied file; edit that import to use another face.
How long should the composition be?
At least 94 frames at 30 fps (188 at 60 fps). The demo uses 140 so the result holds.
Related effects
- Marker Highlight: a flat marker block behind the word instead of glass.
- Blur Out Up: the whole line changes, not one word.
- Inline Highlight: a color shift on one word, no lens.
- Pinned Word: one italic keyword stays fixed while the words around it change.