Dumbbell Shift
Dumbbell rows slide their before and after dots apart, with a +16 summary
$ pnpm dlx shadcn@latest add @remocn/dumbbell-shiftUsage
// 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={165}
fps={30}
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.
Props8
| Prop | Type | Default |
|---|---|---|
| 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. | |
| accent | string"#3B5BFD" Accent color for the hero element. | |
| theme | "dark" | "light""dark" Dark or light palette. | |
| speed | number1 Playback multiplier. | |
- rowsDumbbellRow[]
Categories, each with a before and after value.
Default
DEFAULT_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.
- accentstring
Accent color for the hero element.
Default
"#3B5BFD" - theme"dark" | "light"
Dark or light palette.
Default
"dark" - speednumber
Playback multiplier.
Default
1