Skip to content

Unit grid ​

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.

total units in a grid with filled of them coloured, one by one over fillFor seconds: "7 in 10". A fractional filled colours part of the last unit. Animated: it changes over its whole duration.

tsx
<Composition fps={30} width={640} height={360}>
  <Track id="main" layout="free">
    <Graphic
      id="g1"
      kind="unit-grid"
      total={10}
      filled={7}
      label="7 in 10 viewers"
      start={0}
      duration={3}
    />
  </Track>
</Composition>

Props ​

proptypedefault
totalinteger10
fillednumber (0..400)3
columnsinteger
unit"person" | "circle" | "square""person"
gapnumber (0..0.8)0.25
fillFornumber (0..60)1
labelstring""
colorstring"$primary"
emptystring"$surface"
labelColorstring"$text"
fontstring"$body"

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

MIT licensed.