Skip to content

Arrow ​

An arrow drawn from one point to another, straight or bowed.

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

// Arrow: drawn from one point to another, bowed by `curve`.
export default function Video() {
  return (
    <Composition fps={30} width={1920} height={1080}>
      <Track id="main">
        <Clip id="shot" src="asset:coffeeWide" in={4} out={7} fit="cover" />
      </Track>
      <Track id="over" layout="free">
        <Arrow
          id="kettle"
          start={0.4}
          duration={2.6}
          from={{ x: -620, y: -320 }}
          to={{ x: -140, y: -260 }}
          curve={-120}
          width={10}
        />
      </Track>
    </Composition>
  );
}

The coffee footage is Pixabay videos 209419 and 209424, under the Pixabay Content License.

Props ​

Besides the timing props (start, anchor, at, offset, duration):

paramtypedefaultdescription
idstringThe id of the element it draws.
fromWhere the line starts, in pixels from the frame's centre.
toWhere the head points, in pixels from the frame's centre.
curvenumber0How far the line bows to its left, in pixels; 0 is straight.
colorstring"$accent"The colour of the line and its head.
widthnumber (> 0)6The line's thickness in pixels; the head scales with it.

All components

MIT licensed.