--- name: remotion-markup description: Content, animation and effects best practices version: 4.0.522 --- This is guidance for writing Remotion React Markup. If this is not relevant, load Remotion Best Practices instead. ## Preserve user changes Users 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. ## General rules 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 ```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. Use `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}), }), }} // 👎 Non-inline values and transform strings become harder to edit in Studio const scale = interpolate(frame, [0, 100], [0, 1]); style={{ transform: `scale(${scale})`, }} ``` ## Assets Place assets in the `public/` folder at your project root. Use `staticFile()` to reference files from the `public/` folder. ## Media components Add video and audio using `