Stamp
Plain captions where the words that matter slam down as a rubber stamp the moment they are spoken. A free, MIT-licensed Remotion caption style.
$ pnpm dlx shadcn@latest add @remocn/caption-stampUsage
CaptionStamp takes a timed transcript and renders only the text block, so
place it inside your own AbsoluteFill. Words read as a plain caption line
until a keyword is spoken. Then the word slams down in stampColor inside a
thin stamp frame, dropping from almost twice its size in under a tenth of a
second, settling at its own slight angle and leaving a rough, speckled ink
print. Without keywords, the longest word on each page is stamped, so the
style works on a raw transcript. See
Positioning for safe placements
and Get a transcript for
producing captions.json.
import { AbsoluteFill } from "remotion";
import { CaptionStamp } from "@/components/remocn/caption-stamp";
import captions from "./captions.json";
export const MyScene = () => (
<AbsoluteFill
style={{
justifyContent: "flex-end",
alignItems: "center",
paddingBottom: 108,
paddingInline: 192,
}}
>
<CaptionStamp
captions={captions}
keywords={["thing", "lose", "three", "captions", "sound"]}
/>
</AbsoluteFill>
);Keywords match whole words, ignoring case and punctuation. The stamp frame sits over the word without taking up extra room, so the line never shifts when it lands.
How it animates
The page enters with a short fade and a small rise (160 ms). Every word is plain text in color
until a keyword's start time. At that moment a copy of the word in stampColor, inside a thin
rounded frame, drops from 1.8× its size to 0.96× in 90 ms on an ease-in curve (the slam), then
settles to 1× by 170 ms. Its ink fades in over the first 50 ms, and the plain word underneath fades
out as the stamp lands. Each stamp rests at its own tilt between −8° and −3°, taken from Remotion's
seeded random(), so every render matches the preview. The page fades out over 220 ms when the
speaker pauses.
These timings, the scale range and the tilt range are constants at the top of the copied file
(SLAM_MS, SETTLE_MS, INK_MS, PAD_EM, BORDER_EM), not props: edit them there to change the
size, angle or speed of the hit.
Choosing which words get stamped
keywords={["launch", "free"]}stamps every word on the page that matches, ignoring case and punctuation. A page with no matching word shows a plain caption line.- Omitting
keywords, or passing an empty array, stamps the longest word on each page. - There is no prop that turns stamping off. To show plain captions with no stamp, pass a keyword that never occurs in the transcript, or use Subtitle.
Dependencies
npx shadcn@latest add @remocn/caption-stamp copies the component into components/remocn/
together with the shared helpers it imports (caption-core, glide). The npm dependencies are
remotion and @remotion/captions; install the second with npx remotion add @remotion/captions
so it matches your Remotion version. The rough ink edge is an inline SVG filter, so no image or
texture file is needed. No font is bundled: the caption inherits the font of its parent.
Props11
| Prop | Type | Default |
|---|---|---|
| captions | Caption[]— The timed transcript, in the `Caption` shape from `@remotion/captions`. Times are relative to the start of the surrounding `Sequence`. | |
| keywords | string[]— Words that get stamped. Matched per word, ignoring case and punctuation. When omitted, the longest word on each page is stamped. | |
| stampColor | string"#ef4444" Ink colour of the stamped word and its frame. | |
| texture | booleantrue Roughens the stamp edges and knocks small speckles out of the ink, like a real rubber stamp. | |
| combineTokensWithinMilliseconds | number1200 How much speech one page may span before the next word starts a new page. Pages also break at the end of a sentence and on any pause of at least `holdMs` (300 ms minimum). | |
| holdMs | number600 How long a page stays after its last word when the next page is not already due. It fades out at the end of the hold instead of hanging through the pause. | |
| fontSize | number64 Font size in pixels. | |
| fontWeight | number800 Font weight. The font itself is inherited. | |
| color | string"#ffffff" Colour of the words that are not stamped. | |
| shadow | booleantrue A tight text shadow that keeps the plain words legible over bright footage. | |
| className | string— Classes for the text block — width, font family, `uppercase`. | |
- captionsCaption[]
The timed transcript, in the `Caption` shape from `@remotion/captions`. Times are relative to the start of the surrounding `Sequence`.
Default
— - keywordsstring[]
Words that get stamped. Matched per word, ignoring case and punctuation. When omitted, the longest word on each page is stamped.
Default
— - stampColorstring
Ink colour of the stamped word and its frame.
Default
"#ef4444" - textureboolean
Roughens the stamp edges and knocks small speckles out of the ink, like a real rubber stamp.
Default
true - combineTokensWithinMillisecondsnumber
How much speech one page may span before the next word starts a new page. Pages also break at the end of a sentence and on any pause of at least `holdMs` (300 ms minimum).
Default
1200 - holdMsnumber
How long a page stays after its last word when the next page is not already due. It fades out at the end of the hold instead of hanging through the pause.
Default
600 - fontSizenumber
Font size in pixels.
Default
64 - fontWeightnumber
Font weight. The font itself is inherited.
Default
800 - colorstring
Colour of the words that are not stamped.
Default
"#ffffff" - shadowboolean
A tight text shadow that keeps the plain words legible over bright footage.
Default
true - classNamestring
Classes for the text block — width, font family, `uppercase`.
Default
—