Skip to content

Counter ​

A number that counts to its value, with a label.

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

// Counter: a number that counts to its value, then holds, with a label under it.
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="gradient" />
      </Track>
      <Track id="over" layout="free">
        <Counter id="cups" start={0.2} duration={2.8} to={12400} suffix="+" label="cups poured this year" size={180} />
      </Track>
    </Composition>
  );
}

Props ​

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

paramtypedefault
idstring
fromnumber0
tonumber
decimalsinteger (0..4)0
prefixstring""
suffixstring""
labelstring
xnumber0
ynumber0
sizenumber140
countFornumber1.5

All components

MIT licensed.