Unit Grid

A grid of dots lights up a share of them beside a stat line and caption. A free, MIT-licensed Remotion number animation.

Installation
$ pnpm dlx shadcn@latest add @remocn/unit-grid

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { UnitGrid } from "@/components/remocn/unit-grid";
 
const UnitGridScene = () => (
  <UnitGrid total={100} highlighted={33} caption="1 in 3 teams ship weekly" />
);
 
export const RemotionRoot = () => (
  <Composition
    id="UnitGrid"
    component={UnitGridScene}
    durationInFrames={260}
    fps={60}
    width={1280}
    height={720}
  />
);

Dots fade in across the grid, then the highlighted dots flip to the accent color in a sweeping order while the stat line and caption come in. Pass total, highlighted and caption; a total of 100 lays out as ten by ten, and it ships light and dark through theme.

Props14

PropTypeDefault
total
number100

Number of dots in the grid.

highlighted
number33

How many dots light up.

caption
string"1 in 3 teams ship weekly"

Line shown under the stat.

fontFamily
string"Geist"

Typeface for the copy. Load the font in your project first.

flip
number10

Frames each highlighted unit takes to flip.

dotSize
number0.34

Unit radius as a share of the grid pitch.

accent
string"#3B5BFD"

Accent color for highlights and small marks.

ink
string—

Text color; overrides the theme ink.

background
string—

Background fill; pass "transparent" to drop it.

grain
booleantrue

Film grain over the scene.

scale
number1

Size of the foreground around the frame's center; the background stays put.

delay
number0

Frames to hold the first frame before anything moves.

theme
"dark" | "light""dark"

Color theme, "dark" or "light".

speed
number1

Playback speed multiplier for the whole timeline.

  • totalnumber

    Number of dots in the grid.

    Default100

  • highlightednumber

    How many dots light up.

    Default33

  • captionstring

    Line shown under the stat.

    Default"1 in 3 teams ship weekly"

  • fontFamilystring

    Typeface for the copy. Load the font in your project first.

    Default"Geist"

  • flipnumber

    Frames each highlighted unit takes to flip.

    Default10

  • dotSizenumber

    Unit radius as a share of the grid pitch.

    Default0.34

  • accentstring

    Accent color for highlights and small marks.

    Default"#3B5BFD"

  • inkstring

    Text color; overrides the theme ink.

  • backgroundstring

    Background fill; pass "transparent" to drop it.

  • grainboolean

    Film grain over the scene.

    Defaulttrue

  • scalenumber

    Size of the foreground around the frame's center; the background stays put.

    Default1

  • delaynumber

    Frames to hold the first frame before anything moves.

    Default0

  • theme"dark" | "light"

    Color theme, "dark" or "light".

    Default"dark"

  • speednumber

    Playback speed multiplier for the whole timeline.

    Default1