Skip to content

Counter ​

Deprecated

<Graphic> and its kinds are deprecated and will be removed in a later release; the lint warns on each one. Draw the same thing with <Motion>, <Three> or a <Layer>: the examples show each, and Free code explains them.

A number that counts from from to to over countFor seconds, with an optional prefix, suffix and caption under it. Animated: it changes over its whole duration.

tsx
<Composition fps={30} width={800} height={450}>
  <Track id="main" layout="free">
    <Graphic
      id="g1"
      kind="counter"
      to={1250}
      suffix="+"
      label="customers"
      start={0}
      duration={3}
    />
  </Track>
</Composition>

Props ​

proptypedefault
fromnumber0
tonumber100
decimalsinteger0
prefixstring""
suffixstring""
labelstring""
countFornumber (0..60)1.5
groupingbooleantrue
colorstring"$text"
labelColorstring"$muted"
fontstring"$heading"
labelFontstring"$body"

Plus the <Graphic> props every kind takes. More in Data.

MIT licensed.