
Remotion Best Practices
Ship Remotion videos with React Three Fiber 3D scenes that render without flicker by tying all motion to useCurrentFrame().
Install
npx skills add https://github.com/ncklrs/startup-os-skills --skill remotion-best-practicesWhat is this skill?
- Install @remotion/three via npx/bunx/yarn/pnpm remotion add when missing
- Require ThreeCanvas with width, height, and explicit ambient plus directional lighting
- Ban self-animating shaders and models—only useCurrentFrame()-driven motion for stable renders
- Avoid useFrame()-only animation patterns that flicker during Remotion export
Adoption & trust: 1 installs on skills.sh; 27 GitHub stars; 2/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
Recommended Skills
Video Editagentspace-so/runcomfy-agent-skills
Image To Videoagentspace-so/runcomfy-agent-skills
Image Editagentspace-so/runcomfy-agent-skills
Flux Kontextagentspace-so/runcomfy-agent-skills
Nano Banana 2agentspace-so/runcomfy-agent-skills
Nano Banana Editagentspace-so/runcomfy-agent-skills
Journey fit
Primary fit
Programmatic video with 3D layers is authored during the product-build phase when you compose React/Remotion scenes. Three.js meshes, ThreeCanvas, and R3F components live in the same React frontend surface as the rest of a Remotion composition.
Common Questions / FAQ
Is Remotion Best Practices safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Remotion Best Practices
# Using Three.js and React Three Fiber in Remotion Follow React Three Fiber and Three.js best practices. Only the following Remotion-specific rules need to be followed: ## Prerequisites First, the `@remotion/three` package needs to be installed. If it is not, use the following command: ```bash npx remotion add @remotion/three # If project uses npm bunx remotion add @remotion/three # If project uses bun yarn remotion add @remotion/three # If project uses yarn pnpm exec remotion add @remotion/three # If project uses pnpm ``` ## Using ThreeCanvas You MUST wrap 3D content in `<ThreeCanvas>` and include proper lighting. `<ThreeCanvas>` MUST have a `width` and `height` prop. ```tsx import { ThreeCanvas } from "@remotion/three"; import { useVideoConfig } from "remotion"; const { width, height } = useVideoConfig(); <ThreeCanvas width={width} height={height}> <ambientLight intensity={0.4} /> <directionalLight position={[5, 5, 5]} intensity={0.8} /> <mesh> <sphereGeometry args={[1, 32, 32]} /> <meshStandardMaterial color="red" /> </mesh> </ThreeCanvas> ``` ## No animations not driven by `useCurrentFrame()` Shaders, models etc MUST NOT animate by themselves. No animations are allowed unless they are driven by `useCurrentFrame()`. Otherwise, it will cause flickering during rendering. Using `useFrame()` from `@react-three/fiber` is forbidden. ## Animate using `useCurrentFrame()` Use `useCurrentFrame()` to perform animations. ```tsx const frame = useCurrentFrame(); const rotationY = frame * 0.02; <mesh rotation={[0, rotationY, 0]}> <boxGeometry args={[2, 2, 2]} /> <meshStandardMaterial color="#4a9eff" /> </mesh> ``` ## Using `<Sequence>` inside `<ThreeCanvas>` The `layout` prop of any `<Sequence>` inside a `<ThreeCanvas>` must be set to `none`. ```tsx import { Sequence } from "remotion"; import { ThreeCanvas } from "@remotion/three"; const { width, height } = useVideoConfig(); <ThreeCanvas width={width} height={height}> <Sequence layout="none"> <mesh> <boxGeometry args={[2, 2, 2]} /> <meshStandardMaterial color="#4a9eff" /> </mesh> </Sequence> </ThreeCanvas> ``` --- name: animations description: Fundamental animation skills for Remotion metadata: tags: animations, transitions, frames, useCurrentFrame --- All animations MUST be driven by the `useCurrentFrame()` hook. Write animations in seconds and multiply them by the `fps` value from `useVideoConfig()`. ```tsx import { useCurrentFrame } from "remotion"; export const FadeIn = () => { const frame = useCurrentFrame(); const { fps } = useVideoConfig(); const opacity = interpolate(frame, [0, 2 * fps], [0, 1], { extrapolateRight: 'clamp', }); return ( <div style={{ opacity }}>Hello World!</div> ); }; ``` CSS transitions or animations are FORBIDDEN - they will not render correctly. Tailwind animation class names are FORBIDDEN - they will not render correctly. --- name: assets description: Importing images, videos, audio, and fonts into Remotion metadata: tags: assets, staticFile, images, fonts, public --- # Importing assets in Remotion ## The public folder Place assets in the `public/` folder at your project root. ## Using staticFile() You MUST use `staticFile()` to reference files from the `public/` folder: ```tsx import {Img, staticFile} from 'remotion'; export const MyComposition = () => { return <Img src={staticFile('logo.png')} />; }; ``` The function returns an encoded URL that works correctly when deploying to subdirectories. ## Using with components **Images:** ```tsx import {Img, staticFile} from 'remotion'; <Img src={staticFile('photo.png')} />; ``` **Videos:** ```tsx import {Video} from '@remotion/media'; import {staticFile} from 'remotion'; <Video src={staticFile('clip.mp4')} />; ``` **Audio:** ```tsx import {Audio} from '@re