Home › Remotion (video in React) › Remotion programmatic video Cursor rules

Remotion programmatic video Cursor rules

Cursor rules for Remotion videos in React: frame-driven animation, compositions, sequences, typed props, async asset loading, and rendering.

CursorRemotion (video in React)

How to use

Save this as .cursor/rules/remotion.mdc in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

Note: Review and test before use. Provided as is, without warranty. See Terms.

.cursor/rules/remotion.mdcDownload  
---
description: Remotion composition and animation conventions
globs: ["src/**/*.{ts,tsx}", "remotion.config.ts"]
alwaysApply: false
---

# Remotion

## Commands
- Preview: `npx remotion studio` · Render: `npx remotion render <CompositionId> out/video.mp4` · Still: `npx remotion still <CompositionId> out/frame.png --frame=30`
- Typecheck and lint with the repo scripts before reporting done. Never upgrade one `remotion`/`@remotion/*` package alone; all must share the same version.

## Rules
- Every visual change is a pure function of the frame: read `useCurrentFrame()` and `useVideoConfig()` (`fps`, `width`, `height`, `durationInFrames`). No CSS transitions/animations, `setTimeout`, `requestAnimationFrame` or `Date.now()`; they render differently on each frame or worker.
- Animate with `interpolate(frame, [start, end], [from, to], { extrapolateLeft: 'clamp', extrapolateRight: 'clamp' })` and `spring({ frame, fps, config })`. Express timings in seconds × `fps`, not magic frame numbers.
- Register compositions in `src/Root.tsx` with `id`, `component`, `durationInFrames`, `fps`, `width`, `height` and `defaultProps`. Give props a zod `schema` so they are editable in the Studio and validated on render.
- Time shots with `<Sequence from={...} durationInFrames={...}>` or `<Series>`; inside a sequence, `useCurrentFrame()` is relative to its start.
- Layout with `<AbsoluteFill>`; keep each scene in its own component file under `src/scenes/`.
- Assets go in `public/` and load via `staticFile('name.png')`. Use Remotion's media components (`<Img>`, `<Audio>`, `<OffthreadVideo>`/`<Video>` as the installed version documents), never raw `<img>`/`<video>`, so rendering waits for them.
- Data or font loading: wrap in `delayRender()`/`continueRender()` (or `calculateMetadata` for data that changes duration). Always handle errors with `cancelRender(err)` so a render never hangs.
- Seeded randomness only: `random('seed-string')`, never `Math.random()`.
- Keep text in props, not hardcoded, so the same composition renders many variants.

## Done when
Studio preview plays the changed scene without warnings and a test render of the composition finishes.

More: all Remotion (video in React) rules · all Cursor rules

Related rules

Astro content site rules

Cursor rules for Astro 5 sites with content collections, islands, and zero-JS-by-default pages.

CursorAstro

Chrome extension (Manifest V3) rules

Cursor rules for building Manifest V3 browser extensions with TypeScript and minimal permissions.

CursorChrome extensions

Lit web components rules

Cursor rules for Lit 3 web components in TypeScript: reactive properties, templates, styles, events, and accessibility.

CursorLit / web components

Next.js 16 rules (Cache Components, proxy.ts)

Cursor rules for Next.js 16 App Router: Cache Components with "use cache", proxy.ts, async request APIs, Turbopack.

CursorNext.js

Next.js App Router (TypeScript) rules

Cursor project rules for Next.js 15 App Router apps with TypeScript, Server Components, and Tailwind.

CursorNext.js

Nuxt 3 + Vue rules

Cursor rules for Nuxt 3 / Vue 3 apps using the Composition API, script setup and Pinia.

CursorVue / Nuxt

Get the best new AI prompts every week

One short email a week: the best new prompts and rules for ChatGPT, Claude, Gemini, Midjourney, Cursor and more, plus what changed in the tools. Free, unsubscribe anytime.

Finishes on our newsletter page at beehiiv (opens in a new tab). Or subscribe directly.