Thin Slab

A big '1 day' contrasted with a thin progress slab labeled 14x faster than by hand. A free, MIT-licensed Remotion number animation.

Installation
$ pnpm dlx shadcn@latest add @remocn/thin-slab

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { ThinSlab } from "@/components/remocn/thin-slab";
 
const ThinSlabScene = () => (
  <ThinSlab
    title="Time to your first launch video"
    before={{ value: 14, label: "By hand", unit: "days" }}
    after={{ value: 1, label: "With remocn", unit: "day" }}
  />
);
 
export const RemotionRoot = () => (
  <Composition
    id="ThinSlab"
    component={ThinSlabScene}
    durationInFrames={270}
    fps={60}
    width={1280}
    height={720}
  />
);

A title and the old value appear above a thick slab, then a dashed ghost of that slab holds its place while the slab squeezes to the new thickness and the number counts across. A callout such as '14x faster' fades in last, followed by a light sheen. Pass before and after as value, label and unit, and title; callout is computed unless you set it. It ships light and dark through the theme prop.

Props14

PropTypeDefault
title
string"Time to your first launch video"

Small heading above the numbers.

before
ThinSlabSideDEFAULT_BEFORE

The starting side: value, label and optional unit. Drawn as the thick slab.

after
ThinSlabSideDEFAULT_AFTER

The ending side: value, label and optional unit. The slab squeezes to this.

callout
string—

Text shown after the squeeze. Auto-computed from the two values if omitted.

accent
string"#3B5BFD"

Highlight colour used in the slab and callout.

ink
string—

Text color; overrides the theme ink.

background
string—

Stage colour; pass 'transparent' to layer over other footage.

fontFamily
string"Inter Tight"

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

radius
number14

Corner radius of the slab, in px at 1280 wide.

squeezeDuration
number36

Frames the slab takes to squeeze to its new thickness.

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; 1 is the designed pace.

theme
"dark" | "light""dark"

Ships light and dark.

  • titlestring

    Small heading above the numbers.

    Default"Time to your first launch video"

  • beforeThinSlabSide

    The starting side: value, label and optional unit. Drawn as the thick slab.

    DefaultDEFAULT_BEFORE

  • afterThinSlabSide

    The ending side: value, label and optional unit. The slab squeezes to this.

    DefaultDEFAULT_AFTER

  • calloutstring

    Text shown after the squeeze. Auto-computed from the two values if omitted.

  • accentstring

    Highlight colour used in the slab and callout.

    Default"#3B5BFD"

  • inkstring

    Text color; overrides the theme ink.

  • backgroundstring

    Stage colour; pass 'transparent' to layer over other footage.

  • fontFamilystring

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

    Default"Inter Tight"

  • radiusnumber

    Corner radius of the slab, in px at 1280 wide.

    Default14

  • squeezeDurationnumber

    Frames the slab takes to squeeze to its new thickness.

    Default36

  • 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; 1 is the designed pace.

    Default1

  • theme"dark" | "light"

    Ships light and dark.

    Default"dark"