Skip to content

<Caption> ​

One cue inside <Captions>, written by hand: its text, start and end.

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: the walkthrough

Props ​

proptypedefaultrequired
idstringyes
startnumber (0..∞) | stringyes
endnumber (0..∞) | stringyes
textstringyes
words{ text, start, end }[]

Timed, visual. No children. All elements

MIT licensed.