Skip to content

Badge ​

A short word on a pill that pops in.

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

// Badge: a short word on a pill that pops in.
export default function Video() {
  return (
    <Composition fps={30} width={1920} height={1080}>
      <Track id="main">
        <Clip id="shot" src="asset:coffee" in={12} out={15} fit="cover" />
      </Track>
      <Track id="over" layout="free">
        <Badge id="new" start={0.4} duration={2.6} text="New roast" x={640} y={-380} size={44} />
      </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 component's id; each of its parts' ids starts with it.
textstringThe word on the pill; the pill widens to fit it.
xnumber0The pill's centre, in pixels from the frame's centre.
ynumber0The pill's centre, in pixels below the frame's centre.
sizenumber (> 0)30Letter height in pixels; the pill scales with it.
colorstring"$accent"The pill's colour.
textColorstring"$background"The letters' colour.

All components

MIT licensed.