High Score

A pixel arcade table inserts a new top entry, 'NEW HIGH SCORE', above four lower scores. A free, MIT-licensed Remotion number animation.

Installation
$ pnpm dlx shadcn@latest add @remocn/high-score

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { HighScore } from "@/components/remocn/high-score";
 
const HighScoreScene = () => <HighScore player="YOU" playerScore={999990} flash="NEW HIGH SCORE" />;
 
export const RemotionRoot = () => (
  <Composition
    id="HighScore"
    component={HighScoreScene}
    durationInFrames={165}
    fps={30}
    width={1280}
    height={720}
  />
);

A pixel-font leaderboard slides in, then a new score races up the table, shoving each row down as it overtakes it. At the top the score lands with a shake, the initials type in behind a block cursor and a flash line slams in before the logo rises. Pass rows for the existing scores, plus player, playerScore and flash to make it yours. It ships light and dark through the theme prop.

Props16

PropTypeDefault
rows
HighScoreEntry[]—

The table before the new run, best first. Up to five rows are shown.

player
string"RMC"

Initials typed in once the new score lands at the top.

playerScore
number999990

The new score. Should beat the current #1.

title
string"HIGH SCORES"

Small table title shown before the flash.

flash
string"NEW HIGH SCORE"

The flash that replaces the title once the initials are in.

columns
[string, string, string]["RANK", "NAME", "SCORE"]

Column labels over the table: rank, name and score.

stagger
number3

Frames between rows as the table slides in.

accent
string"#3B5BFD"

Small cursor block while the initials are typed.

ink
string—

Text color; overrides the theme ink.

background
string—

Background fill; pass "transparent" to drop it.

fontFamily
string"Silkscreen"

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

logo
React.ReactNode—

Replaces the remocn mark.

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.

theme
"dark" | "light""dark"

Ships light and dark.

speed
number1

Playback speed multiplier; 1 is the designed pace.

  • rowsHighScoreEntry[]

    The table before the new run, best first. Up to five rows are shown.

  • playerstring

    Initials typed in once the new score lands at the top.

    Default"RMC"

  • playerScorenumber

    The new score. Should beat the current #1.

    Default999990

  • titlestring

    Small table title shown before the flash.

    Default"HIGH SCORES"

  • flashstring

    The flash that replaces the title once the initials are in.

    Default"NEW HIGH SCORE"

  • columns[string, string, string]

    Column labels over the table: rank, name and score.

    Default["RANK", "NAME", "SCORE"]

  • staggernumber

    Frames between rows as the table slides in.

    Default3

  • accentstring

    Small cursor block while the initials are typed.

    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"Silkscreen"

  • logoReact.ReactNode

    Replaces the remocn mark.

  • 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

  • theme"dark" | "light"

    Ships light and dark.

    Default"dark"

  • speednumber

    Playback speed multiplier; 1 is the designed pace.

    Default1