---
name: remotion-markup
description: Content, animation and effects best practices
metadata:
tags: remotion, react, markup
---
This is guidance for writing Remotion React Markup.
If this is not relevant, load [Remotion Best Practices](../remotion-best-practices/SKILL.md) instead.
## General rules
Animate properties using `useCurrentFrame()` and `interpolate()`.
Use `Easing.bezier()` to customize timing, including jumpy or overshooting motion.
Use `Easing.spring()` if you want spring animations.
Structure your markup according to [Remotion Interactivity Best Practices](../remotion-interactivity/SKILL.md)
```tsx
import { useCurrentFrame, Easing, interpolate, Interactive } from "remotion";
export const FadeIn = () => {
const frame = useCurrentFrame();
return (
Hello World!
);
};
```
Keep the `interpolate()` call inline in the `style` prop.
Prefer `scale`, `translate`, `rotate` CSS properties over `transform`.
```tsx
// 👍 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}),
}),
}}
// 👎 Hidden values and transform strings become harder to edit in Studio
const scale = interpolate(frame, [0, 100], [0, 1]);
style={{
transform: `scale(${scale})`,
}}
```
CSS transitions or animations are FORBIDDEN - they will not render correctly.
Tailwind animation class names are FORBIDDEN - they will not render correctly.
Place assets in the `public/` folder at your project root.
Use `staticFile()` to reference files from the `public/` folder.
Add video and audio using `@remotion/media`.
Add images using the `` component.
Use `staticFile()` for files in `public/` or pass a remote URL directly:
```tsx
import { Audio, Video } from "@remotion/media";
import { staticFile, CanvasImage } from "remotion";
export const MyComposition = () => {
return (
<>
>
);
};
```
## Cropping
See [cropping.md](cropping.md) for supported components, crop props, Studio
controls, animation, and custom component support.
To delay content wrap it in `` and use `from`.
To limit the duration of an element, use `durationInFrames` of ``.
`` by default is an absolute fill covering the scene.
For inline content, use `layout="none"`.
```tsx
const Main = () => {
const {fps} = useVideoConfig();
return (
);
}
export const Title = () => {
const frame = useCurrentFrame();
return (
Title
);
};
export const Subtitle = () => {
const frame = useCurrentFrame();
return (
Subtitle
);
};
```
## Maps
See [Remotion Maps](remotion-maps/REFERENCE.md) for choosing a map technique.
## Text highlights and annotations
See [text-highlights.md](text-highlights.md) for text highlights (highlight markers), circles, underlines, strike-throughs, crossed-off text, boxes, and brackets.
## Voiceover
See [voiceover.md](voiceover.md) for adding AI-generated voiceover to Remotion compositions using ElevenLabs TTS.
## Trimming
See [trimming.md](trimming.md) for trimming patterns - cutting the beginning or end of animations.
## Embedding Videos
See [embedding-videos.md](embedding-videos.md) for advanced knowledge about embedding videos - trimming, volume, speed, looping, pitch.
## Video editing
See [video-editing.md](video-editing.md) for structuring editable video timelines in Remotion Studio.
## Embedding Audio
See [audio.md](audio.md) for advanced audio features like trimming, volume, speed, pitch.
## Transitions
See [transitions.md](transitions.md) for scene transition patterns.
## Visual and pixel effects
When creating a visual effect, consider whether it is feasible using CSS and HTML, or whether a shader is needed. Order or preference:
1. Normal Remotion/HTML/CSS/SVG/filter/blend/mask animation
2. An effect applied to the element directly (`