Skip to content

Background ​

A full-frame gradient, dots or grid to put beneath everything.

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

// Background: a full-frame backdrop on the track beneath everything; dots here, or a gradient or a grid.
export default function Video() {
  return (
    <Composition fps={30} width={1920} height={1080}>
      <Track id="back" layout="free">
        <Background id="bg" start={0} duration={3} variant="dots" spacing={56} />
      </Track>
      <Track id="over" layout="free">
        <Title
          id="name"
          start={0.3}
          duration={2.7}
          size={120}
          font="$heading"
          enter={{ type: "slide-up", duration: 0.5 }}
        >
          Shed Coffee
        </Title>
      </Track>
    </Composition>
  );
}

Props ​

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

paramtypedefaultdescription
idstringThe id of the element it draws.
variant"gradient" | "dots" | "grid""gradient"gradient from one colour to the other, dots or grid in the second colour over the first.
widthnumber (> 0)1920The frame's size: a background covers it.
heightnumber (> 0)1080The frame's height in pixels.
colors[string, string]["$background","$primary"]The base colour and a second: the gradient's two ends, or the dots or grid drawn over the base.
spacingnumber (> 0)48The dots' or the grid's spacing, in pixels.

All components

MIT licensed.