Skills
Skill 7 of 12
Content, animation and effects best practices
4 minutes · 772 words · 42 sections
Install
npx skills add remotion-dev/skills --skill remotion-markupnpx skills add remotion-dev/skillsThe first command installs just this skill, by the name in its SKILL.md; the second installs the whole repository.
This is guidance for writing Remotion React Markup. If this is not relevant, load Remotion Best Practices instead.
Also bundled
3dUsers may make edits in the code outside of the conversation.
If you detect a surprising change made in the meanwhile, don’t overwrite it, assume it was intentional or ask for confirmation.
Drive animations using useCurrentFrame() and interpolate().
CSS transition or animation will not render correctly, they need to refactored.
Tailwind animation class will not render correctly, they need to be refactored.
Use Easing.bezier() and Easing.spring() to customize timing.
Structure your markup according to Remotion Interactivity Best Practices
import { useCurrentFrame, Easing, interpolate, Interactive } from "remotion";
export const FadeIn = () => {
const frame = useCurrentFrame();
return (
<Interactive.Div
name="Title"
style={{
opacity: interpolate(frame, [0, 2 * fps], [0, 1], {
extrapolateRight: "clamp",
extrapolateLeft: "clamp",
easing: Easing.bezier(0.16, 1, 0.3, 1),
}),
}}
>
Hello World!
</Interactive.Div>
);
};Keep the interpolate() call inline in the style prop.
Use scale, translate, rotate CSS properties over transform.
// 👍 Inline editable keyframes and transform shorthands
style={{
scale: interpolate(frame, [0, 100], [0, 1], {
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
easing: Easing.spring({damping: 200}),
output: 'perceptual-scale' // For `scale` animations, use "output: 'perceptual-scale'"
}),
translate: interpolate(frame, [0, 100], ["0px 0px", "100px 100px"], {
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
easing: Easing.spring({damping: 200}),
}),
rotate: interpolate(frame, [0, 100], ["20deg", "90deg"], {
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
easing: Easing.spring({damping: 200}),
}),
}}
// 👎 Non-inline values and transform strings become harder to edit in Studio
const scale = interpolate(frame, [0, 100], [0, 1]);
style={{
transform: `scale(${scale})`,
}}Place assets in the public/ folder at your project root.
Use staticFile() to reference files from the public/ folder.
Add video and audio using <Video> and <Audio> from @remotion/media.
Add images using the <CanvasImage> component.
Add animated GIFs, APNG, WebP or AVIF images using <AnimatedImage>, use @remotion/gif if not using Chrome.
Use staticFile() for files in public/ or pass a remote URL directly:
import { Audio, Video } from "@remotion/media";
import { staticFile, CanvasImage, AnimatedImage } from "remotion";
export const MyComposition = () => {
return (
<>
<Video src={staticFile("video.mp4")} style={{ opacity: 0.5 }} />
<Audio src={staticFile("audio.mp3")} />
<CanvasImage
src={staticFile("logo.png")}
style={{ width: 100, height: 100 }}
/>
<Video src="https://remotion.media/video.mp4" />
<AnimatedImage src={staticFile('nyancat.gif')} />
</>
);
};import {
AbsoluteFill,
Easing,
Interactive,
interpolate,
useCurrentFrame,
useVideoConfig
} from "remotion";
export const Empty = () => {
const {fps} = useVideoConfig();
const frame = useCurrentFrame();
return (
<AbsoluteFill
name="Scene"
style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'white'
}}
>
<Interactive.Div
name="Title"
style={{
opacity: interpolate(frame, [1 * fps, 2 * fps], [0, 1], {
extrapolateRight: "clamp",
extrapolateLeft: "clamp",
easing: Easing.bezier(0.16, 1, 0.3, 1),
}),
fontSize: 88
}}
>
Title
</Interactive.Div>
<Interactive.Div
name="Subtitle"
style={{
opacity: interpolate(frame, [2 * fps, 3 * fps, 8 * fps, 10 * fps], [0, 1, 1, 0], {
extrapolateRight: "clamp",
extrapolateLeft: "clamp",
easing: [Easing.bezier(0.16, 1, 0.3, 1), Easing.linear, Easing.bezier(0.16, 1, 0.3, 1)],
}),
fontSize: 32
}}
>
Subtitle
</Interactive.Div>
</AbsoluteFill>
);
}Most components (<AbsoluteFill>, <Interactive.*> <Img>, <AnimatedImage>, <CanvasImage>, <HtmlInCanvas>, <Solid>, <Sequence> from remotion, <Video> and <Audio> from @remotion/media, <Gif>, and more) support the following props:
<Img from={1 * fps} {/* ... */}/>
<Video from={1 * fps} {/* ... */}/>
<Interactive.Div from={1 * fps} {/* ... */}/>When the element starts appearing in the timelien.
<Img durationInFrames={20 * fps} {/* ... */}/>
<Interactive.Div durationInFrames={20 * fps} {/* ... */}/>For how long the layer plays in the timeline.
For media, pass the natural duration of the media: <Video durationInFrames={29.322 * fps}/>
Useful for components whose internal clock should start later:
// Trim away first 2 seconds of footage
<Video trimBefore={2 * fps} {/* ... */} />
// `useCurrenFrame()` for children starts at `10 * fps`
<Sequence trimBefore={10 * fps} {/* ... */} />If a component does not support these props, wrap it in<Sequence> from remotion, which has them.
layout="absolute-fill" makes the Sequence behave like AbsoluteFilllayout="none" is “headless” mode, no wrapper element is used.See Remotion Maps (opens in a new tab) if wanting to include maps in the video.
See text-highlights.md (opens in a new tab) for text highlights (highlight markers), circles, underlines, strike-throughs, crossed-off text, boxes.
See multi-scene-video.md (opens in a new tab) if planning to make a video with multiple subsequent scenes.
When a scene or group of layers deserves its own editable timeline, follow connected-compositions.md (opens in a new tab). Prefer this structure for substantial scenes in a multi-scene video.
See voiceover.md (opens in a new tab) for adding an AI-generated voiceover to Remotion compositions using ElevenLabs TTS.
See embedding-videos.md (opens in a new tab) for advanced knowledge about embedding videos - trimming, volume, speed, looping, pitch.
See audio.md (opens in a new tab) for advanced audio features like trimming, volume, speed, pitch.
See video-editing.md (opens in a new tab) for structuring editable video timelines in Remotion Studio.
See cropping.md (opens in a new tab) if needing to crop the visible rectangle of a component.
See transitions.md (opens in a new tab) for scene transition patterns.
When creating a visual effect, consider whether it is feasible using CSS and HTML, or whether a shader is needed.
Order or preference:
<Video>, <Img>), or by wrapping the content in <HtmlInCanvas> (opens in a new tab), which also accepts effects:createEffect() via effects.md (opens in a new tab) when no preset is available.See ./3d.md (opens in a new tab) for 3D content in Remotion using Three.js and React Three Fiber.
When needing to use sound effects, load the ./sfx.md (opens in a new tab) file for more information.
When needing to visualize audio (spectrum bars, waveforms, bass-reactive effects), load the ./audio-visualization.md (opens in a new tab) file for more information.
For static maps, animated routes and markers, geographic explainers, Mapbox, MapLibre, MapTiler, GeoJSON, or 3D geographic flyovers, load Remotion Maps (opens in a new tab).
When dealing with captions or subtitles, load the Remotion Captions skill for more information.
Is the recommended way to load fonts in Remotion. See google-fonts.md (opens in a new tab) for how to load Google Fonts.
See local-fonts.md (opens in a new tab) for how to load local fonts.
See gifs.md (opens in a new tab) for how to display GIFs synchronized with Remotion’s timeline.
See images.md (opens in a new tab) for sizing and positioning images, dynamic image paths, and getting image dimensions.
See lottie.md (opens in a new tab) for embedding Lottie animations in Remotion.
See timing.md (opens in a new tab) for more timing techniques for interpolate().
See parameters.md (opens in a new tab) for making a composition parametrizable by adding a Zod schema.
See measuring-dom-nodes.md (opens in a new tab) for measuring DOM element dimensions in Remotion.
See measuring-text.md (opens in a new tab) for measuring text dimensions, fitting text to containers, and checking overflow.
For some video operations, such as trimming videos or detecting silence, FFmpeg should be used. Load the ./ffmpeg.md (opens in a new tab) file for more information.
When needing to detect and trim silent segments from video or audio files, load the ./silence-detection.md (opens in a new tab) file.
See calculate-metadata.md (opens in a new tab) for dynamically set composition duration, dimensions, and props.
See compositions.md (opens in a new tab) for how to define stills, folders, default props and for how to nest compositions. For Studio navigation into a scene’s own timeline, use connected compositions (opens in a new tab).
See sequencing.md (opens in a new tab) for more sequencing patterns - delay, trim, limit duration of items.
Use npx remotion add to add new packages with the right version:
npx remotion add @remotion/mediaThis goes for @remotion/* packages, mediabunny, @mediabunny/*, zod, and @huggingface/transformers.
When a visual check is useful, open the Remotion Studio for an interactive preview.
You can also use Rendering to inspect one or several frames as images.
main, last pushed 24 September 2026.SKILL.md, not by matching a directory convention. One layout observed: skills/*/SKILL.md./remotion-dev/skills.md, and each skill at its own .md URL.63 files · 564 KB
Everything this skill ships beside its prose. 61 of them are set here as subchapters of skill 7; the other 2 are described rather than reproduced.
Templates, schemas and fixtures the skill draws on.
Everything else published alongside the skill.
agents/1 file · 310 B
remotion-maps/agents/1 file · 293 B
remotion-maps/assets/1 file · 1 KB
remotion-maps/1 file · 1 KB
remotion-maps/techniques/cesium/assets/5 files · 23 KB
remotion-maps/techniques/cesium/references/3 files · 16 KB
remotion-maps/techniques/cesium/scripts/1 file · 5 KB
remotion-maps/techniques/cesium/1 file · 4 KB
remotion-maps/techniques/mapbox/references/1 file · 4 KB
remotion-maps/techniques/mapbox/1 file · 13 KB
remotion-maps/techniques/maplibre/references/1 file · 4 KB
remotion-maps/techniques/maplibre/1 file · 14 KB
remotion-maps/techniques/maptiler/assets/5 files · 17 KB
remotion-maps/techniques/maptiler/assets/sample-data/1 file · 13 KB
remotion-maps/techniques/maptiler/references/4 files · 19 KB
remotion-maps/techniques/maptiler/scripts/1 file · 7 KB
remotion-maps/techniques/maptiler/1 file · 4 KB
remotion-maps/techniques/static-map/1 file · 1 KB