<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
| prop | type | default | required | description |
|---|---|---|---|---|
id | string | yes | The element's name: unique in the file, and what anchors, ducking and the editor refer to it by. | |
start | number (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" | string | Overlays: start relative to another element's start, or to its end with id.end. | ||
at | string | With anchor: a word, shot or silence of the anchor's source (word:14655); the start is where the anchor plays it, plus offset. | ||
offset | number | Seconds added to the start that anchor and at give; negative starts earlier. | ||
duration | number (> 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. | ||
transform | Where 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 more | How it mixes with what is under it, as CSS mix-blend-mode does. | ||
blendOpacity | number (0..1) | How strongly it blends: multiplied into its opacity. | ||
enter | How it comes in: a fade, slide, scale or wipe over its first seconds, with an easing. | |||
exit | How it goes out, over its last seconds, as enter. | |||
style | string | A theme preset for shapes. | ||
shape | "rectangle" | "circle" | "ellipse" | "triangle" | "arrow" | … 4 more | yes | Which shape it draws. | |
width | number (> 0) | The shape's box, in pixels; left out, 200. | ||
height | number (> 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. | ||
fill | string | | A colour, or { type, color, gradient, opacity } for a gradient or no fill. | ||
stroke | The outline: colour, width in pixels, opacity, dashes, caps and joins. | |||
shadow | A 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. | ||
cornerRadius | number (0..∞) | string | A rectangle's rounded corners, in pixels or a theme token such as $radius. | ||
cornerRadii | A rectangle's corners rounded one by one, in pixels. | |||
starPoints | integer (3..∞) | How many points a star has; left out, 5. | ||
innerRadius | number (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