Area Compare

Two discs compare bundle sizes while 14x smaller settles in big type. A free, MIT-licensed Remotion number animation.

Installation
$ pnpm dlx shadcn@latest add @remocn/area-compare

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { AreaCompare } from "@/components/remocn/area-compare";
 
const AreaCompareScene = () => (
  <AreaCompare
    label="Bundle size"
    beforeValue={1200}
    afterValue={84}
    unit="KB"
  />
);
 
export const RemotionRoot = () => (
  <Composition
    id="AreaCompare"
    component={AreaCompareScene}
    durationInFrames={300}
    fps={60}
    width={1280}
    height={720}
  />
);

Two discs, sized by area, start at the same scale, then the second shrinks to its true ratio while a tag appears and the multiplier settles in large type with the verdict word. Pass before and after names, beforeValue and afterValue with a unit, and set shape to circle or square. Ships dark and light via theme.

Props19

PropTypeDefault
label
string"Bundle size"

Small heading naming what is measured.

before
string"Before"

Name of the original item.

after
string"remocn"

Name of the improved item.

beforeValue
number1200

Original measurement.

afterValue
number84

Improved measurement; the ratio sets the multiplier.

unit
string"KB"

Unit appended to the values.

verdict
string"smaller"

Word after the multiplier, such as smaller.

shape
"circle" | "square""circle"

Draw the two items as circles or squares.

shrink
number40

Frames the shape takes to shrink to the new value.

accent
string"#3B5BFD"

Accent color for the hero element.

ink
string—

Text color; overrides the theme ink.

background
string—

Background fill; pass "transparent" to drop it.

fontFamily
string"Instrument Serif"

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

logo
React.ReactNode—

Replaces the remocn mark.

grain
booleantrue

Film grain over the scene.

theme
"dark" | "light""dark"

Dark or light palette.

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 multiplier.

  • labelstring

    Small heading naming what is measured.

    Default"Bundle size"

  • beforestring

    Name of the original item.

    Default"Before"

  • afterstring

    Name of the improved item.

    Default"remocn"

  • beforeValuenumber

    Original measurement.

    Default1200

  • afterValuenumber

    Improved measurement; the ratio sets the multiplier.

    Default84

  • unitstring

    Unit appended to the values.

    Default"KB"

  • verdictstring

    Word after the multiplier, such as smaller.

    Default"smaller"

  • shape"circle" | "square"

    Draw the two items as circles or squares.

    Default"circle"

  • shrinknumber

    Frames the shape takes to shrink to the new value.

    Default40

  • accentstring

    Accent color for the hero element.

    Default"#3B5BFD"

  • inkstring

    Text color; overrides the theme ink.

  • backgroundstring

    Background fill; pass "transparent" to drop it.

  • fontFamilystring

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

    Default"Instrument Serif"

  • logoReact.ReactNode

    Replaces the remocn mark.

  • grainboolean

    Film grain over the scene.

    Defaulttrue

  • theme"dark" | "light"

    Dark or light palette.

    Default"dark"

  • 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 multiplier.

    Default1