Skip to content

<Shape> ​

A vector shape (rectangle, circle, star, polygon, path) with fill, stroke and shadow.

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

export default function Video() {
  return (
    <Composition fps={30} width={960} height={540} background={{ mode: "color", color: "#101421" }}>
      <Track id="shapes" layout="free">
        <Shape
          id="card"
          start={0}
          duration={3}
          shape="rectangle"
          width={360}
          height={200}
          fill="#f3ead6"
          cornerRadius={24}
          transform={{ position: { x: -170, y: 0 } }}
          enter={{ type: "slide-up", duration: 0.6 }}
        />
        <Shape
          id="ring"
          start={0.4}
          duration={2.6}
          shape="circle"
          width={180}
          height={180}
          fill={{ type: "none" }}
          stroke={{ color: "#c8402a", width: 14 }}
          transform={{ position: { x: 220, y: 0 } }}
          enter={{ type: "scale", duration: 0.5 }}
        />
      </Track>
    </Composition>
  );
}

Used in: the walkthrough · Product demo with zoom-ins

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.
enterHow it comes in: a fade, slide, scale or wipe over its first seconds, with an easing.
exitHow it goes out, over its last seconds, as enter.
stylestringA theme preset for shapes.
shape"rectangle" | "circle" | "ellipse" | "triangle" | "arrow" | … 4 moreyesWhich shape it draws.
widthnumber (> 0)The shape's box, in pixels; left out, 200.
heightnumber (> 0)The shape's box height, in pixels; left out, 200.
points{ x, y }[]A polygon's or path's corners, as fractions of the box from its top left.
fillstring |A colour, or { type, color, gradient, opacity } for a gradient or no fill.
strokeThe outline: colour, width in pixels, opacity, dashes, caps and joins.
shadowA drop shadow: colour, blur and offset in pixels.
shadows{ color, blur, x, y, spread, inset }[]Several shadows, drawn in order, for layered or inner shadows.
cornerRadiusnumber (0..∞) | stringA rectangle's rounded corners, in pixels or a theme token such as $radius.
cornerRadiiA rectangle's corners rounded one by one, in pixels.
starPointsinteger (3..∞)How many points a star has; left out, 5.
innerRadiusnumber (0..1)A star's inner corners, as a fraction of its outer radius; left out, 0.5.

Timed, visual, transformable. Children: effect, keyframe, mask. All elements

MIT licensed.