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):
| param | type | default | description |
|---|---|---|---|
id | string | The component's id; each of its parts' ids starts with it. | |
x | number | 0 | The card's centre, in pixels from the frame's centre. |
y | number | 0 | The card's centre, in pixels below the frame's centre. |
width | number (> 0) | The card's width in pixels; the whole frame when left out. | |
height | number (> 0) | The card's height in pixels. Left out, like width: the whole frame. | |
fill | string | "$surface" | The card's background colour. |
cornerRadius | number (0..∞) | 0 | How round the card's corners are, in pixels. |
size | number (> 0) | 120 | Letter 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. |