Skip to content

<Nested> ​

A sequence written once as a component and placed like a clip.

tsx
import { Clip, Composition, Nested, Title, Track } from "@cutcraft/kit";

export default function Video() {
  return (
    <Composition fps={30} width={960} height={540}>
      <Track id="main">
        <Clip id="intro" src="asset:aurora" in={0} out={1.5} fit="cover" />
        {/* A sequence written once and placed like a clip, here scaled into a picture-in-picture. */}
        <Nested id="card" of={EndCard} duration={2} transform={{ scale: 0.8 }} />
      </Track>
    </Composition>
  );
}

function EndCard() {
  return (
    <>
      <Track id="card-bg">
        <Clip id="card-shot" src="asset:cells" in={0} out={2} fit="cover" />
      </Track>
      <Track id="card-text">
        <Title id="card-title" anchor="card-shot" duration={2} size={56}>
          Thanks for watching
        </Title>
      </Track>
    </>
  );
}

Props ​

proptypedefaultrequireddescription
idstringyesThe element's name: unique in the file, and what anchors, ducking and the editor refer to it by.
startnumber (0..∞)Seconds from the start of the video. Free-layout tracks only; on a sequence track the element follows the one before it.
anchor"start" | stringOverlays: start relative to another element's start, or to its end with id.end.
atstringWith anchor: a word, shot or silence of the anchor's source (word:14655); the start is where the anchor plays it, plus offset.
offsetnumberSeconds added to the start that anchor and at give; negative starts earlier.
durationnumber (> 0) | "fill" | "source" | { match } |How long it plays: seconds; "source" for the whole trimmed source; "fill" to run to the end of the composition; { match: id } for as long as another element; { until: id } to end when another element ends.
transformWhere it sits and how it is turned: position, scale, rotation, anchor, opacity, rounded corners and crop.
fit"contain" | "cover" | "stretch" | "none"How it fills the frame: contain shows all of it, cover fills the frame and crops, stretch distorts to fill, none keeps its own size.
blend"normal" | "multiply" | "screen" | "overlay" | "darken" | … 13 moreHow it mixes with what is under it, as CSS mix-blend-mode does.
blendOpacitynumber (0..1)How strongly it blends: multiplied into its opacity.
ofany | stringyesA pure helper component returning tracks, or a file reference. Validated at collect time.
innumber (0..∞) | stringWhere in the nested sequence it starts, in its own seconds.
outnumber (0..∞) | stringWhere in the nested sequence it ends, as in.
volumenumber (0..4)1A gain on all its sound: 1 as it is, 0 muted.

Timed, visual, audible, trims its source, transformable. Children: effect, keyframe, mask, speedKey, freeze. All elements

MIT licensed.