Skip to content

<Mask> ​

Shows only a shape of its clip, with a feathered edge or inverted.

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

export default function Video() {
  return (
    <Composition fps={30} width={960} height={540} background={{ mode: "color", color: "#f3ead6" }}>
      <Track id="main">
        <Clip id="shot" src="asset:spiral" in={0} out={3} fit="cover">
          <Mask id="oval" shape={{ ellipse: { cx: 0.5, cy: 0.5, rx: 0.3, ry: 0.4 } }} feather={20} />
        </Clip>
      </Track>
    </Composition>
  );
}

Props ​

proptypedefaultrequireddescription
idstringyesThe mask's name.
type"shape" | "drawn""shape"shape for a rectangle, ellipse or polygon; drawn for a bezier path.
shape{ rect } | { ellipse } |The region it shows: { rect }, { ellipse } or { polygon }, in the clip's pixels.
pathA drawn mask's outline: bezier points with handles, closed or open.
feathernumber (0..100)0Softens the mask's edge, in pixels.
invertedbooleanfalseShows everything outside the region instead of inside.
expansionnumber (-100..100)0Grows the region outwards, or shrinks it when negative, in pixels.
opacitynumber (0..1)1How much the mask hides: 1 hides fully outside the region, 0 not at all.
easing"linear" | "ease-in" | "ease-out" | "ease-in-out""linear"How the mask moves between its keyframes.

Children: keyframe. All elements

MIT licensed.