Skip to content

QuoteCard ​

A passage on a paper card with its source, and a marker over the phrases that matter.

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

// QuoteCard: a passage with its source, and a marker that sweeps across the phrases that matter.
export default function Video() {
  return (
    <Composition fps={30} width={1920} height={1080} theme={{ extends: "paper" }}>
      <Track id="back" layout="free">
        <Background id="bg" start={0} duration={3} variant="dots" />
      </Track>
      <Track id="over" layout="free">
        <QuoteCard
          id="quote"
          start={0.2}
          duration={2.8}
          width={1100}
          size={44}
          source="A barista's handbook, on freshness"
          text="Roasted coffee is at its best between four and fourteen days after roasting. Once ground, it loses most of its aroma within fifteen minutes."
          highlights={[
            { text: "four and fourteen days", offset: 0.6 },
            { text: "within fifteen minutes", offset: 1.3 },
          ]}
        />
      </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)860The card's width in pixels; the passage wraps inside it.
sourcestringWhere the words come from, in small type above them.
textstringThe passage; its line breaks are kept.
sizenumber (> 0)40Letter height in pixels; the padding and corners scale with it.
fillstring"#ffffff"The paper's colour.
colorstring"#16161a"The words' colour.
accentstring"$accent"The marker's colour, for highlights that do not name their own.
highlights{ text, color, at, offset }[][]The phrases to mark, each at its own cue; each must appear in text as written.

All components

MIT licensed.