Skip to content

Remotion

Remotion renders a React composition to video one frame at a time, often across several browser tabs at once. Most effects in @shavin/fx can follow that frame instead of their own clock, so every frame of the video is exact and repeatable. @shavin/fx never imports Remotion; you connect the two in your composition.

Drive effects from the frame

Wrap the effects in FxTimeProvider and pass the current time in seconds. Every effect inside draws exactly that moment and runs no clock of its own. The hold function lets an effect pause the render while it loads an image, font or texture; map it to Remotion's delayRender and continueRender.

import { AbsoluteFill, continueRender, delayRender, useCurrentFrame, useVideoConfig } from "remotion";
import { FxTimeProvider, LightField } from "@shavin/fx";

export function LaunchIntro() {
  const frame = useCurrentFrame();
  const { fps } = useVideoConfig();

  return (
    <AbsoluteFill>
      <FxTimeProvider
        time={frame / fps}
        hold={(label) => {
          const handle = delayRender(label);
          return () => continueRender(handle);
        }}
      >
        <LightField preset="blades" />
      </FxTimeProvider>
    </AbsoluteFill>
  );
}

One effect at a time

Effects that follow the frame also take a time prop, which wins over the provider. Use it to offset one effect or to run it at a different speed. Effects with a one-shot motion (a burst, a lap of light, a scroll strip) take progress from 0 to 1 instead, so you can tie them to Remotion's interpolate.

const frame = useCurrentFrame();
const { fps } = useVideoConfig();

// Starts two seconds into the video
<Aura state="thinking" time={Math.max(0, frame / fps - 2)} />

// One lap of light over the first 90 frames
<EdgeLight progress={interpolate(frame, [0, 90], [0, 1], { extrapolateRight: "clamp" })} />

Same layout in every tab

Remotion splits a render across tabs, and each tab mounts the composition fresh. Effects in @shavin/fx never call Math.random(); dots, particles and glitches come from a seeded generator, so every tab draws the same layout and the chunks join without a jump. Where an effect takes a seed prop, keep it fixed for the whole video.

Which effects work

Each effect page has a Works with section saying how it behaves in Remotion. Most effects are frame-exact. Charts and the HUD set have no animation to drive and render as they are. These effects run on their own clock, for interactive physics or live input, and are for live pages only:

Live pages are unchanged

Without a provider or a time prop, effects run live as usual, pause when off screen and respect reduced motion. The same component works on a page and in a video.

Configure Theme
Theme
Brand Color
Custom
Gray Family
Appearance
Radius
Scaling
Panel Style
Heading Font
Body Font