Stat Rail

A headline card shrinks over scenery while a rail of stats steps through on the left. A free, MIT-licensed Remotion number animation.

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

Usage

tsx
// src/Root.tsx
import { Composition, staticFile } from "remotion";
import { StatRail } from "@/components/remocn/stat-rail";
 
const StatRailScene = () => (
  <StatRail image={staticFile("hero.jpg")} tagline="The *future* of launch video is code" stats={[{ value: "120", label: "components ready to install" }, { value: "4", label: "minutes to first render" }]} />
);
 
export const RemotionRoot = () => (
  <Composition
    id="StatRail"
    component={StatRailScene}
    durationInFrames={288}
    fps={60}
    width={1280}
    height={720}
  />
);

The tagline fills the frame over the image, then the image shrinks to the right as the rail slides in and each stat steps up in turn, the last one landing as a chip. By default it uses a stock image that only exists in the Remocn repo, so pass your own image URL or staticFile(...). Wrap a tagline word in asterisks to set it in the accent serif; it ships light and dark through theme.

The ground is a live gradients.sh shader (GshGround), installed with the component as @remocn/gsh. Pick another look with the ground preset prop.

Props18

PropTypeDefault
stats
Stat[]DEFAULT_STATS

Stats on the rail, up to four, each with a value and label.

image
string—

Image URL for the scenery card. The default only exists in the Remocn repo.

tagline
string"The *future* of launch video is code"

Headline over the image; wrap a word in asterisks to accent it.

hold
number30

Frames the full-frame tagline holds before the card shrinks.

stagger
number2

Frames between tagline words.

logo
React.ReactNode—

Replaces the remocn mark.

theme
"dark" | "light""dark"

Color theme, "dark" or "light".

background
string—

Ground background color override.

ink
string—

Text color; overrides the theme ink.

fontFamily
string"Inter Tight"

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

accent
string—

Accent color for the highlighted stat and chip.

card
string—

Background color of the stat card.

faded
string—

Color of stats that have not stepped in yet.

ground
GshPresetId—

Gradient preset used as the background ground.

groundParams
Partial<GradientParams>—

Overrides for the gradient ground's parameters.

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.

  • statsStat[]

    Stats on the rail, up to four, each with a value and label.

    DefaultDEFAULT_STATS

  • imagestring

    Image URL for the scenery card. The default only exists in the Remocn repo.

  • taglinestring

    Headline over the image; wrap a word in asterisks to accent it.

    Default"The *future* of launch video is code"

  • holdnumber

    Frames the full-frame tagline holds before the card shrinks.

    Default30

  • staggernumber

    Frames between tagline words.

    Default2

  • logoReact.ReactNode

    Replaces the remocn mark.

  • theme"dark" | "light"

    Color theme, "dark" or "light".

    Default"dark"

  • backgroundstring

    Ground background color override.

  • inkstring

    Text color; overrides the theme ink.

  • fontFamilystring

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

    Default"Inter Tight"

  • accentstring

    Accent color for the highlighted stat and chip.

  • cardstring

    Background color of the stat card.

  • fadedstring

    Color of stats that have not stepped in yet.

  • groundGshPresetId

    Gradient preset used as the background ground.

  • groundParamsPartial<GradientParams>

    Overrides for the gradient ground's parameters.

  • 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