Skip to content

TypeCard ​

A card of big type that builds line by line, with pills and struck-out lines.

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

// TypeCard: big type that builds line by line. A line can sit on a pill, and a line can be struck out.
export default function Video() {
  return (
    <Composition fps={30} width={1920} height={1080} theme={{ extends: "paper" }}>
      <Track id="over" layout="free">
        <TypeCard
          id="job"
          start={0}
          duration={3}
          size={150}
          lines={[
            { text: "COFFEE IS", tone: "muted", size: 84 },
            { text: "BITTER", offset: 0.4, struck: { offset: 1.2 } },
            { text: "SWEET", offset: 1.5, pill: "$accent" },
            { text: "when it is fresh", offset: 1.9, size: 64, tone: "muted" },
          ]}
        />
      </Track>
    </Composition>
  );
}

Props ​

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

paramtypedefaultdescription
idstringThe component's id; each of its parts' ids starts with it.
xnumber0The card's centre, in pixels from the frame's centre.
ynumber0The card's centre, in pixels below the frame's centre.
widthnumber (> 0)The card's width in pixels; the whole frame when left out.
heightnumber (> 0)The card's height in pixels. Left out, like width: the whole frame.
fillstring"$surface"The card's background colour.
cornerRadiusnumber (0..∞)0How round the card's corners are, in pixels.
sizenumber (> 0)120Letter height in pixels, for the lines that do not set their own.
align"left" | "center""center"The lines sit centred, or flush left.
lines{ text, size, tone, pill, color, at, offset, struck }[]The lines, top to bottom; each comes in at its own cue.

All components

MIT licensed.