Graph Relayout

A node graph rearranges itself through several layouts as nodes slide, appear and reconnect. A free, MIT-licensed Remotion product scene.

Installation
$ pnpm dlx shadcn@latest add @remocn/graph-relayout

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { GraphRelayout } from "@/components/remocn/graph-relayout";
 
const GraphRelayoutScene = () => (
  <GraphRelayout theme="light" kicker="Workflow" cursorName="Sam" />
);
 
export const RemotionRoot = () => (
  <Composition
    id="GraphRelayout"
    component={GraphRelayoutScene}
    durationInFrames={316}
    fps={60}
    width={1280}
    height={720}
  />
);

A graph starts with a prompt node and a short chain, then each layout step moves nodes into new positions while a named cursor drags one of them, with nodes entering, leaving and edges rewiring. Each layout carries a title that changes as the graph does. Pass layouts (positions and edges per step) with a catalog of node specs to describe your own pipeline; kicker and cursorName set the label and cursor tag. 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.

Props16

PropTypeDefault
theme
"dark" | "light""dark"

Light or dark interface.

accent
string—

Accent color for edges and highlights.

ink
string—

Text color; overrides the theme ink.

catalog
Record<string, GraphNodeSpec>DEFAULT_CATALOG

Node specs by id: label, icons, tint, columns, input text.

layouts
GraphLayout[]DEFAULT_LAYOUTS

Ordered layouts: title, node positions (0 to 1), edges, optional note.

kicker
string"Use case"

Small label shown above each layout title.

cursorName
string"Mia"

Name tag on the dragging cursor.

hold
number36

Frames the first layout holds before the first relayout.

dots
booleantrue

Dot grid behind the graph.

fontFamily
string"Geist"

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

ground
GshPresetId—

Gradient shader preset for the background.

groundParams
Partial<GradientParams>—

Overrides for the shader preset parameters.

background
string—

Solid fill in place of the gradient ground; pass "transparent" to drop it.

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.

  • theme"dark" | "light"

    Light or dark interface.

    Default"dark"

  • accentstring

    Accent color for edges and highlights.

  • inkstring

    Text color; overrides the theme ink.

  • catalogRecord<string, GraphNodeSpec>

    Node specs by id: label, icons, tint, columns, input text.

    DefaultDEFAULT_CATALOG

  • layoutsGraphLayout[]

    Ordered layouts: title, node positions (0 to 1), edges, optional note.

    DefaultDEFAULT_LAYOUTS

  • kickerstring

    Small label shown above each layout title.

    Default"Use case"

  • cursorNamestring

    Name tag on the dragging cursor.

    Default"Mia"

  • holdnumber

    Frames the first layout holds before the first relayout.

    Default36

  • dotsboolean

    Dot grid behind the graph.

    Defaulttrue

  • fontFamilystring

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

    Default"Geist"

  • groundGshPresetId

    Gradient shader preset for the background.

  • groundParamsPartial<GradientParams>

    Overrides for the shader preset parameters.

  • backgroundstring

    Solid fill in place of the gradient ground; pass "transparent" to drop it.

  • 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