Skip to content

<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 ​

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.
stylestringA theme preset for svg elements.
srcstringAn SVG file from the manifest, as asset:<id>. Give this or content.
contentstringInline SVG markup. Give this or src.
viewBoxThe part of the drawing to show, in its own units, as the SVG viewBox attribute.
preserveAspectRatiostringHow the drawing fits its box, as the SVG attribute of that name (xMidYMid meet).
colorRecolours it: tint keeps the shading and colours it, replace paints every drawn pixel; opacity is how much.
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.

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

MIT licensed.