Dumbbell Shift

Dumbbell rows slide their before and after dots apart, with a +16 summary. A free, MIT-licensed Remotion number animation.

Installation
$ pnpm dlx shadcn@latest add @remocn/dumbbell-shift

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { DumbbellShift } from "@/components/remocn/dumbbell-shift";
 
const DumbbellShiftScene = () => (
  <DumbbellShift
    beforeLabel="Before"
    afterLabel="With remocn"
    rows={[
      { label: "Launch videos", before: 2, after: 9 },
      { label: "Changelogs", before: 4, after: 7 },
      { label: "Social clips", before: 3, after: 19 },
    ]}
  />
);
 
export const RemotionRoot = () => (
  <Composition
    id="DumbbellShift"
    component={DumbbellShiftScene}
    durationInFrames={330}
    fps={60}
    width={1280}
    height={720}
  />
);

Rows enter with a before dot and an after dot, the dots slide apart row by row, then the rows sort and the biggest gain is lit with a summary caption. Pass rows (label, before, after), plus beforeLabel, afterLabel and an optional summaryCaption. Ships dark and light via theme.

Props17

PropTypeDefault
rows
DumbbellRow[]DEFAULT_ROWS

Categories, each with a before and after value.

beforeLabel
string"Before"

Legend text for the before dot.

afterLabel
string"With remocn"

Legend text for the after dot.

summaryCaption
string—

Line under the summary; defaults to the winning row name.

max
number—

Axis maximum; defaults to a rounded value above the data.

logo
React.ReactNode—

Replaces the remocn mark.

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"Schibsted Grotesk"

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

stagger
number5

Frames between rows as their dots start to slide.

slideDuration
number26

Frames each dot takes to slide from its before value to its after value.

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.

grain
booleantrue

Film grain over the scene.

theme
"dark" | "light""dark"

Dark or light palette.

speed
number1

Playback multiplier.

  • rowsDumbbellRow[]

    Categories, each with a before and after value.

    DefaultDEFAULT_ROWS

  • beforeLabelstring

    Legend text for the before dot.

    Default"Before"

  • afterLabelstring

    Legend text for the after dot.

    Default"With remocn"

  • summaryCaptionstring

    Line under the summary; defaults to the winning row name.

  • maxnumber

    Axis maximum; defaults to a rounded value above the data.

  • logoReact.ReactNode

    Replaces the remocn mark.

  • 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"Schibsted Grotesk"

  • staggernumber

    Frames between rows as their dots start to slide.

    Default5

  • slideDurationnumber

    Frames each dot takes to slide from its before value to its after value.

    Default26

  • 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

  • grainboolean

    Film grain over the scene.

    Defaulttrue

  • theme"dark" | "light"

    Dark or light palette.

    Default"dark"

  • speednumber

    Playback multiplier.

    Default1