--- 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 ( <>