Remotion video motion

From devton/agentic-workflow-blueprint · View interactive version

Remotion video motion is an AI agent skill from the GitHub repository devton/agentic-workflow-blueprint. Scaffold, configure, and animate React frontend components inside Remotion compositions for programmatic video creation, high-fidelity UI motion demos, micro-animations, and dynamic video rendering.

How to use this skill

Skill file

agentic-workflows-blueprint.workflow.remotion-video-motion

Goal

Scaffold, configure, and animate React frontend components inside Remotion compositions for programmatic video creation, high-fidelity UI motion demos, micro-animations, and dynamic video rendering.

Scope

Triggers

Inputs

Invariants

  1. Deterministic Frame Rendering:
  1. Asset Path Resolution:
  1. Component Decoupling (Adapter Pattern):
  1. Spring Physics over Linear Easing:
  1. Tailwind CSS & Asset Compatibility:

Architecture and workflow phases

┌────────────────────────────────────────────────────────────────────────┐
│  Phase 1: Environment & Dependency Verification                         │
│  - Check / Install `remotion`, `@remotion/cli`, `@remotion/player`     │
├────────────────────────────────────────────────────────────────────────┤
│  Phase 2: Component Decoupling & Adapter Wrapping                      │
│  - Wrap React UI in Frame-aware Props & Mock Context Providers         │
├────────────────────────────────────────────────────────────────────────┤
│  Phase 3: Root Composition & Schema Definition (Zod)                   │
│  - Define <Composition id="..." component={...} schema={z.object()}/>  │
├────────────────────────────────────────────────────────────────────────┤
│  Phase 4: Motion Choreography & Spring Physics                         │
│  - Implement `useCurrentFrame`, `useVideoConfig`, `interpolate`, `spring`│
│  - Layer elements using `<AbsoluteFill>` and `<Sequence>`              │
├────────────────────────────────────────────────────────────────────────┤
│  Phase 5: Asset & Font Preloading                                      │
│  - Preload web fonts via `@remotion/google-fonts` or `@fontsource`     │
├────────────────────────────────────────────────────────────────────────┤
│  Phase 6: Studio Preview & CLI Render Pipeline                         │
│  - Verify via Remotion Studio & Render MP4 / WebM / GIF                │
└────────────────────────────────────────────────────────────────────────┘

Step-by-step execution guide

Phase 1: Environment Detection & Setup

Check package.json for remotion dependencies. If not present:

npm install remotion @remotion/cli @remotion/player @remotion/media-utils zod

If Tailwind CSS is used in the project:

npm install @remotion/tailwind

Phase 2: React Component Decoupling (Adapter Pattern)

Wrap the target React UI component in a pure frame-driven container so it can be controlled seamlessly by Remotion props:

// src/video/adapters/MyComponentAdapter.tsx
import React from 'react';
import { useCurrentFrame, useVideoConfig, spring, interpolate } from 'remotion';
import { MyTargetComponent } from '../../components/MyTargetComponent';

export interface AdapterProps {
  title: string;
  subtitle?: string;
  highlightColor?: string;
}

export const MyComponentAdapter: React.FC<AdapterProps> = ({ title, subtitle, highlightColor = '#3b82f6' }) => {
  const frame = useCurrentFrame();
  const { fps } = useVideoConfig();

  // Smooth entrance spring
  const scale = spring({
    frame,
    fps,
    config: { damping: 12, stiffness: 100, mass: 0.5 },
  });

  // Opacity fade-in
  const opacity = interpolate(frame, [0, 15], [0, 1], {
    extrapolateLeft: 'clamp',
    extrapolateRight: 'clamp',
  });

  return (
    <div style={{ opacity, transform: `scale(${scale})` }}>
      <MyTargetComponent title={title} subtitle={subtitle} accentColor={highlightColor} />
    </div>
  );
};

Phase 3: Root Composition & Zod Schema Definition

Register the composition in Remotion's root entrypoint (e.g., src/video/Root.tsx or remotion/Root.tsx):

// src/video/Root.tsx
import React from 'react';
import { Composition } from 'remotion';
import { z } from 'zod';
import { MyComponentAdapter } from './adapters/MyComponentAdapter';
import '../index.css'; // Import global Tailwind or CSS styles

export const myComponentSchema = z.object({
  title: z.string(),
  subtitle: z.string().optional(),
  highlightColor: z.string().optional(),
});

export const RemotionRoot: React.FC = () => {
  return (
    <>
      <Composition
        id="MyComponentDemo"
        component={MyComponentAdapter}
        durationInFrames={150} // 5 seconds at 30 fps
        fps={30}
        width={1920}
        height={1080}
        schema={myComponentSchema}
        defaultProps={{
          title: 'Automated Finance',
          subtitle: 'Multi-chain DEX & Web3 Automations',
          highlightColor: '#8b5cf6',
        }}
      />
    </>
  );
};

Phase 4: Motion Choreography & Sequences

Structure multi-element animations using <Sequence> and <AbsoluteFill>:

import { AbsoluteFill, Sequence, spring, useCurrentFrame, useVideoConfig } from 'remotion';

export const MotionShowcase: React.FC = () => {
  const frame = useCurrentFrame();
  const { fps } = useVideoConfig();

  const titleSlide = spring({ frame, fps, config: { damping: 15 } });

  return (
    <AbsoluteFill className="bg-slate-950 text-white justify-center items-center">
      {/* Intro Sequence (Frames 0 to 60) */}
      <Sequence from={0} durationInFrames={60}>
        <div style={{ transform: `translateY(${(1 - titleSlide) * 50}px)` }}>
          <h1 className="text-5xl font-bold">Introducing Feature</h1>
        </div>
      </Sequence>

      {/* Main Component Sequence (Frames 45 onwards) */}
      <Sequence from={45}>
        <MyComponentAdapter title="Live Product Demo" />
      </Sequence>
    </AbsoluteFill>
  );
};

Phase 5: Studio Preview & Production Rendering

  1. Launch Studio for Interactive Editing:

```bash

npx remotion studio src/video/Root.tsx

```

  1. Render Production Video (MP4):

```bash

npx remotion render MyComponentDemo out/video.mp4

```

  1. Render Animated GIF / WebM:

```bash

npx remotion render MyComponentDemo out/demo.gif

```


Review gate

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.