Sankey Flow

Flows from several sources merge into one target block that reads 12.4k

Installation
$ pnpm dlx shadcn@latest add @remocn/sankey-flow

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { SankeyFlow } from "@/components/remocn/sankey-flow";
 
const SankeyFlowScene = () => (
  <SankeyFlow
    target="remocn"
    label="videos rendered"
    sources={[
      { label: "Marketing", value: 4100 },
      { label: "Product", value: 3200 },
      { label: "Docs", value: 2400 },
    ]}
  />
);
 
export const RemotionRoot = () => (
  <Composition
    id="SankeyFlow"
    component={SankeyFlowScene}
    durationInFrames={140}
    fps={30}
    width={1280}
    height={720}
  />
);

Source nodes appear on the left, then flows of different widths draw one by one into a single target block that lands with the combined total and label. Pass sources (label and value), target, and label; the total is the sum unless you set total. Ships dark and light via theme.

Props7

PropTypeDefault
sources
SankeySource[]DEFAULT_SOURCES

Source nodes on the left, each with a label and value.

target
string"remocn"

Name on the merged target block.

total
number—

Number shown on the target; defaults to the sum of sources.

label
string"videos rendered"

Caption under the total.

accent
string"#3B5BFD"

Accent color for the hero element.

theme
"dark" | "light""dark"

Dark or light palette.

speed
number1

Playback multiplier.

  • sourcesSankeySource[]

    Source nodes on the left, each with a label and value.

    DefaultDEFAULT_SOURCES

  • targetstring

    Name on the merged target block.

    Default"remocn"

  • totalnumber

    Number shown on the target; defaults to the sum of sources.

  • labelstring

    Caption under the total.

    Default"videos rendered"

  • accentstring

    Accent color for the hero element.

    Default"#3B5BFD"

  • theme"dark" | "light"

    Dark or light palette.

    Default"dark"

  • speednumber

    Playback multiplier.

    Default1