<Svg>
One-off vector art from inline SVG markup or a file.
tsx
import { Composition, Svg, Track } from "@cutcraft/kit";
export default function Video() {
return (
<Composition fps={30} width={960} height={540} background={{ mode: "color", color: "#101421" }}>
<Track id="art" layout="free">
<Svg
id="sun"
start={0}
duration={3}
transform={{ scale: 4 }}
enter={{ type: "fade", duration: 0.6 }}
content="<svg viewBox='0 0 100 100'><circle cx='50' cy='50' r='26' fill='#e0a458'/><g stroke='#e0a458' stroke-width='5' stroke-linecap='round'><path d='M50 6v12M50 82v12M6 50h12M82 50h12M19 19l8 8M73 73l8 8M19 81l8-8M73 27l8-8'/></g></svg>"
/>
</Track>
</Composition>
);
}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. | ||
style | string | A theme preset for svg elements. | ||
src | string | An SVG file from the manifest, as asset:<id>. Give this or content. | ||
content | string | Inline SVG markup. Give this or src. | ||
viewBox | The part of the drawing to show, in its own units, as the SVG viewBox attribute. | |||
preserveAspectRatio | string | How the drawing fits its box, as the SVG attribute of that name (xMidYMid meet). | ||
color | Recolours it: tint keeps the shading and colours it, replace paints every drawn pixel; opacity is how much. | |||
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. |
Timed, visual, transformable. Children: effect, keyframe, mask. All elements