Word Gap Media
A video tile slots into the gap between "Launch all" and "of this". A free, MIT-licensed Remotion text animation.
In Remotion, Word Gap Media opens a gap in the middle of a headline, for example between Launch all and of this, and slides a media tile into it that cycles through images with captions. Use it to show the screens behind a claim inside the sentence.
$ pnpm dlx shadcn@latest add @remocn/word-gap-mediaGood to know
- Length: 142 frames of motion at 30 fps (284 at 60 fps) with the default props. That is the minimum for its
Sequence; add your own hold on top. The Usage example below is a 60 fps composition, so the numbers it hands to Remotion (durationInFrames,Sequencelengths) are doubled. The component's own props counted in frames stay in 30 fps frames at any frame rate, 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. - Font: loads Instrument Sans itself through
@remotion/google-fonts. PassfontFamilyto use your own face, and load that font in your project. - The tile cycles still images from
images; it does not play video. Setbackgroundto a solid color to drop the shader ground.
Usage
// src/Root.tsx
import { Composition } from "remotion";
import { WordGapMedia } from "@/components/remocn/word-gap-media";
const WordGapMediaScene = () => (
<WordGapMedia before="Launch all" after="of this" images={["/shots/hero.jpg", "/shots/gallery.jpg"]} aspects={[0.8, 1.36]} captions={["Hero", "Gallery"]} />
);
export const RemotionRoot = () => (
<Composition
id="WordGapMedia"
component={WordGapMediaScene}
durationInFrames={336}
fps={60}
width={1280}
height={720}
/>
);A sentence is split around a gap and a media tile opens inside it, cycling through your images with progress bars and captions. By default it uses staticFile images that only exist in the Remocn repo, so pass your own images (public paths or full URLs). It ships light and dark.
The ground is a live gradients.sh shader (GshGround), installed with the component as @remocn/gsh. Pick another look with the ground preset prop.
Props16
| Prop | Type | Default |
|---|---|---|
| before | string"Launch all" Text before the gap. | |
| after | string"of this" Text after the gap. | |
| images | string[]DEFAULT_IMAGES Image paths or URLs cycled through the tile. | |
| aspects | number[]DEFAULT_ASPECTS Aspect ratio (width over height) for each image. | |
| captions | string[]DEFAULT_CAPTIONS Label shown for each image. | |
| stagger | number3 Frames between words as each side builds. | |
| accent | string— Accent colour (any CSS colour). | |
| ink | string— Text colour (any CSS colour). | |
| background | string— Solid fill in place of the gradient ground; 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. | |
| speed | number1 Playback speed multiplier for the whole timeline. | |
| theme | "dark" | "light""dark" Colour scheme; ships light and dark. | |
| ground | GshPresetId— Gradient preset used for the backdrop. | |
| groundParams | Partial<GradientParams>— Overrides for the gradient preset parameters. | |
- beforestring
Text before the gap.
Default
"Launch all" - afterstring
Text after the gap.
Default
"of this" - imagesstring[]
Image paths or URLs cycled through the tile.
Default
DEFAULT_IMAGES - aspectsnumber[]
Aspect ratio (width over height) for each image.
Default
DEFAULT_ASPECTS - captionsstring[]
Label shown for each image.
Default
DEFAULT_CAPTIONS - staggernumber
Frames between words as each side builds.
Default
3 - accentstring
Accent colour (any CSS colour).
- inkstring
Text colour (any CSS colour).
- backgroundstring
Solid fill in place of the gradient ground; 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 - speednumber
Playback speed multiplier for the whole timeline.
Default
1 - theme"dark" | "light"
Colour scheme; ships light and dark.
Default
"dark" - groundGshPresetId
Gradient preset used for the backdrop.
- groundParamsPartial<GradientParams>
Overrides for the gradient preset parameters.