--- name: remotion-markup description: Best practices for writing Remotion React Markup metadata: tags: remotion, react, markup --- This is guidance for writing Remotion React Markup. If this is not relevant, load [Remotion Best Practices](../SKILL.md) instead. ## General rules Animate properties using `useCurrentFrame()` and `interpolate()`. Use `interpolate()` over `spring()`. Use `Easing.bezier()` to customize timing, including jumpy or overshooting motion. Use `Easing.spring()` if you want spring animations HTML Elements which make sense to be made interactive in the Studio should use `Interactive`: `
` -> ``. Set a descriptive `name` prop such as `name="Hero title"` for `Interactive`, `Solid`, `Sequence`. ```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]), translate: interpolate(frame, [0, 100], ["0px 0px", "100px 100px"]), rotate: interpolate(frame, [0, 100], ["20deg", "90deg"]), }} // 👎 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 } from "remotion"; export const MyComposition = () => { return ( <>