Press Stat

A monospace caption presses out and a large figure counts up beside it to a percentage. A free, MIT-licensed Remotion number animation.

Installation
$ pnpm dlx shadcn@latest add @remocn/press-stat

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { PressStat } from "@/components/remocn/press-stat";
 
const PressStatScene = () => (
  <PressStat before="Edit time down" value={73} suffix="%" />
);
 
export const RemotionRoot = () => (
  <Composition
    id="PressStat"
    component={PressStatScene}
    durationInFrames={240}
    fps={60}
    width={1280}
    height={720}
  />
);

The caption rises in letter by letter, then presses open to make room while the figure inflates and counts from from up to value. Pass before, value and suffix; it ships light and dark through theme.

Props15

PropTypeDefault
before
string"Edit time down"

Caption shown before the figure.

value
number73

Final number the figure counts up to.

from
number0

Number the count starts from.

prefix
string""

Text drawn before the number.

suffix
string"%"

Text drawn after the number, such as a percent sign.

pressAt
number30

Frame at which the number presses in and starts counting.

countLength
number42

Frames the count takes to reach the value.

accent
string—

Accent color for highlights and small marks.

ink
string—

Text color; overrides the theme ink.

background
string—

Background color override. Pass "transparent" to composite over other layers.

fontFamily
string"IBM Plex Mono"

Typeface for the copy. Load the 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 for the whole timeline.

theme
"dark" | "light""dark"

Color theme, "dark" or "light".

  • beforestring

    Caption shown before the figure.

    Default"Edit time down"

  • valuenumber

    Final number the figure counts up to.

    Default73

  • fromnumber

    Number the count starts from.

    Default0

  • prefixstring

    Text drawn before the number.

    Default""

  • suffixstring

    Text drawn after the number, such as a percent sign.

    Default"%"

  • pressAtnumber

    Frame at which the number presses in and starts counting.

    Default30

  • countLengthnumber

    Frames the count takes to reach the value.

    Default42

  • accentstring

    Accent color for highlights and small marks.

  • inkstring

    Text color; overrides the theme ink.

  • backgroundstring

    Background color override. Pass "transparent" to composite over other layers.

  • fontFamilystring

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

    Default"IBM Plex Mono"

  • 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

  • speednumber

    Playback speed multiplier for the whole timeline.

    Default1

  • theme"dark" | "light"

    Color theme, "dark" or "light".

    Default"dark"