<Captions>
Subtitles from an asset's transcript that follow the clips through every trim.
tsx
import { Captions, Clip, Composition, Track } from "@cutcraft/kit";
export default function Video() {
return (
<Composition fps={30} width={540} height={960}>
<Track id="main">
<Clip id="talk" src="asset:speaker" in="word:0" out="word:12.end" fit="cover" />
</Track>
{/* Words come from the clip's transcript and follow it through every trim. */}
<Captions id="captions" src="asset:speaker" animation="karaoke" style={{ size: 36 }} />
</Composition>
);
}Used in: Kinetic type · Captions and key points · the walkthrough · Product demo with zoom-ins · Talking-head cut · Variants from one file · Vertical clip from a podcast
Props
| prop | type | default | required |
|---|---|---|---|
id | string | yes | |
src | string | ||
style | string | | ||
animation | "none" | "word-highlight" | "word-by-word" | "karaoke" | "typewriter" | "none" | |
maxChars | integer | ||
maxDuration | number | 5 | |
maxGap | number (0..∞) | 0.8 | |
breakAfter | string[] |
Visual. Children: caption. All elements