一键导入
remotion-best-practices
Best practices for Remotion - Video creation in React. Use when working with video animations, compositions, or React-based video content.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Best practices for Remotion - Video creation in React. Use when working with video animations, compositions, or React-based video content.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Design interfaces following Google's Material Design system, the unified visual language bridging digital and physical worlds. Emphasizes bold graphic design, intentional motion, adaptive layouts, and the material metaphor. Use when building modern, accessible, delightful user interfaces across platforms.
Three.js scene setup, cameras, renderer, and 3D basics. Use when setting up 3D scenes, creating cameras, configuring renderers, or working with 3D objects and transforms.
Remove signs of AI-generated writing to make text sound more natural and human-written. Use when editing or reviewing documentation.
Remove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.
| name | remotion-best-practices |
| description | Best practices for Remotion - Video creation in React. Use when working with video animations, compositions, or React-based video content. |
Best practices for creating videos programmatically with Remotion in React.
Use this skill whenever you are dealing with Remotion code to obtain domain-specific knowledge about video creation, animations, and compositions in React.
Compositions are the building blocks of Remotion videos. Each composition represents a video with specific dimensions, duration, and frame rate.
import { Composition } from 'remotion';
export const RemotionRoot = () => {
return (
<>
<Composition
id="MyVideo"
component={MyVideo}
durationInFrames={150}
fps={30}
width={1920}
height={1080}
/>
</>
);
};
Use useCurrentFrame() and useVideoConfig() for time-based animations:
import { useCurrentFrame, useVideoConfig, interpolate } from 'remotion';
export const MyComponent = () => {
const frame = useCurrentFrame();
const { fps, durationInFrames } = useVideoConfig();
const opacity = interpolate(frame, [0, 30], [0, 1], {
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
});
return <div style={{ opacity }}>Hello World</div>;
};
Use <Sequence> to layout content over time:
import { Sequence } from 'remotion';
export const MyVideo = () => {
return (
<>
<Sequence from={0} durationInFrames={60}>
<Scene1 />
</Sequence>
<Sequence from={60} durationInFrames={90}>
<Scene2 />
</Sequence>
</>
);
};
Import assets using staticFile():
import { staticFile, Img, Video, Audio } from 'remotion';
export const MyComponent = () => {
return (
<>
<Img src={staticFile('logo.png')} />
<Video src={staticFile('video.mp4')} />
<Audio src={staticFile('audio.mp3')} />
</>
);
};
import { spring, interpolate } from 'remotion';
// Spring animation
const scale = spring({
frame,
fps,
config: {
damping: 200,
},
});
// Easing
const position = interpolate(frame, [0, 100], [0, 500], {
easing: (t) => t * t, // Ease in
});
import { interpolate } from 'remotion';
export const TextReveal = ({ text }: { text: string }) => {
const frame = useCurrentFrame();
const charsToShow = Math.floor(interpolate(
frame,
[0, 30],
[0, text.length],
{ extrapolateRight: 'clamp' }
));
return <div>{text.slice(0, charsToShow)}</div>;
};
import { Audio } from 'remotion';
export const MyVideo = () => {
return (
<>
<Audio src={staticFile('music.mp3')} volume={0.5} />
<Audio
src={staticFile('voiceover.mp3')}
startFrom={30} // Start at frame 30
endAt={120} // End at frame 120
/>
</>
);
};
Remotion works great with Three.js and React Three Fiber:
import { ThreeCanvas } from '@remotion/three';
import { useCurrentFrame } from 'remotion';
export const ThreeDScene = () => {
const frame = useCurrentFrame();
return (
<ThreeCanvas>
<ambientLight intensity={0.5} />
<mesh rotation={[0, frame * 0.01, 0]}>
<boxGeometry args={[1, 1, 1]} />
<meshStandardMaterial color="orange" />
</mesh>
</ThreeCanvas>
);
};
const fadeIn = interpolate(frame, [0, 30], [0, 1]);
const fadeOut = interpolate(frame, [durationInFrames - 30, durationInFrames], [1, 0]);
const opacity = Math.min(fadeIn, fadeOut);
const scale = spring({
frame: frame - startFrame,
fps,
from: 0,
to: 1,
config: { mass: 0.5 },
});
const translateY = interpolate(
frame,
[0, 30],
[100, 0],
{ extrapolateRight: 'clamp' }
);
This skill covers Remotion fundamentals. For more specific topics, refer to: