Packed Count
A counter climbs with digits packing tight, then a blue fill sweeps across it under a caption. A free, MIT-licensed Remotion number animation.
In Remotion, Packed Count is a digit-by-digit packed counter: a views or downloads number climbs and gains one digit at a time with the digits packing tight, then a blue fill sweeps across it.
$ pnpm dlx shadcn@latest add @remocn/packed-countHow to make a views or downloads counter that gains one digit at a time in Remotion
A counter for views, replays or downloads whose digits pack tight as each new place joins, followed by a color sweep, is one component. You don't need fitText or measureText from @remotion/layout-utils, tabular-nums tricks or a loadFont call. Install it and pass the number:
npx shadcn@latest add @remocn/packed-countvalueis where the count lands andfromwhere it starts;prefixandsuffixadd signs.countLengthsets the length of the climb.- Digits rise out of a mask, and the figure widens each time a new place joins. Once the count lands, the
accentfill (blue by default) sweeps across the figure digit by digit. - The
labelcaption slides in above the number; there is no prop to put it below. To move it, edit the copied source in your project.
For a counter that leans forward in italics use Lean Count.
Good to know
- Length: 110 frames of motion at 30 fps (220 at 60 fps) with the default props. That is the minimum for its
Sequence; add your own hold on top. The Usage example below is a 60 fps composition with a hold, so itsdurationInFrames(260) is longer than twice the motion. The component's own props counted in frames stay in 30 fps frames at any frame rate, see Frame rate. - Installs:
remotion,@remotion/google-fontsfrom npm, plus the remocn helpersglide,frame-rate,timeline. The shadcn CLI copies the source into your project; nothing else is needed at runtime. - Font: loads Figtree itself through
@remotion/google-fonts, so the default needs no setup. PassfontFamilyto use your own face, and load that font in your project.
Usage
// src/Root.tsx
import { Composition } from "remotion";
import { PackedCount } from "@/components/remocn/packed-count";
const PackedCountScene = () => <PackedCount value={41900} from={120} label="replays on a single launch clip" />;
export const RemotionRoot = () => (
<Composition
id="PackedCount"
component={PackedCountScene}
durationInFrames={260}
fps={60}
width={1280}
height={720}
/>
);Digits rise out of a mask as the counter climbs from a small start, packing tight and gaining a place each time a new digit joins. A caption slides in above at the start, and once the count lands a blue fill sweeps across the figure digit by digit. Pass value, from and label; accent recolors the fill. It ships light and dark through theme.
Props14
| Prop | Type | Default |
|---|---|---|
| value | number41900 The number the count lands on. | |
| from | number120 Starting number the count climbs from. | |
| countLength | number64 Frames the count takes to climb to its value; the fill sweep follows it. | |
| prefix | string"" Text before the number. | |
| suffix | string"" Text after the number. | |
| label | string"replays on a single launch clip" Caption above the number. | |
| accent | string— Color of the final fill sweep; defaults to a sky blue. | |
| ink | string— Text color; overrides the theme ink. | |
| background | string— Stage background color; overrides the theme ground. | |
| fontFamily | string"Figtree" Typeface for the copy. The default loads itself; load any other font in your project first. | |
| 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. | |
| speed | number1 Playback speed multiplier. | |
| theme | "dark" | "light""dark" Light or dark palette. | |
- valuenumber
The number the count lands on.
Default
41900 - fromnumber
Starting number the count climbs from.
Default
120 - countLengthnumber
Frames the count takes to climb to its value; the fill sweep follows it.
Default
64 - prefixstring
Text before the number.
Default
"" - suffixstring
Text after the number.
Default
"" - labelstring
Caption above the number.
Default
"replays on a single launch clip" - accentstring
Color of the final fill sweep; defaults to a sky blue.
- inkstring
Text color; overrides the theme ink.
- backgroundstring
Stage background color; overrides the theme ground.
- fontFamilystring
Typeface for the copy. The default loads itself; load any other font in your project first.
Default
"Figtree" - scalenumber
Size of the foreground around the frame's center; the background stays put.
Default
1 - delaynumber
Frames to hold the first frame before anything moves.
Default
0 - speednumber
Playback speed multiplier.
Default
1 - theme"dark" | "light"
Light or dark palette.
Default
"dark"