packages/docs/elements/submit-an-element.mdx
Have a small, remixable Remotion Element? We'd like to see it.
A strong Element is easy to preview, easy to copy into a Remotion project, and useful as a video building block.
An Element should ideally be a single, self-contained TSX file.
Start from the reusable template in packages/docs/elements-template/.
The preferred format is:
For example:
export const MyElement = () => {
return <div style={{width: '100%', height: '100%'}}>...</div>;
};
For animation, keep the timing inside the component but let the surrounding project decide how long the Element appears:
import {Interactive, interpolate, useCurrentFrame} from 'remotion';
export const AnimatedElement = () => {
const frame = useCurrentFrame();
return (
<Interactive.Div
style={{
width: '100%',
height: '100%',
opacity: interpolate(frame, [0, 20], [0, 1]),
translate: interpolate(frame, [0, 20], ['0px 40px', '0px 0px']),
}}
>
Hello
</Interactive.Div>
);
};
To give an Element a fixed size, set elementWidth and elementHeight on the ElementPage in index.mdx:
<ElementPage
component={MyElement}
elementWidth={900}
elementHeight={260}
>
Then make the Element fill that area in its source file:
import {AbsoluteFill} from 'remotion';
export const MyElement = () => {
return <AbsoluteFill>...</AbsoluteFill>;
};
Use this for overlays, lower thirds, callouts, motion graphics, cards, badges, and data animations.
Do not put the wrapper <Sequence> into the Element source file.
Prefer zero dependencies. If an Element needs binary assets, reference them by URL:
const imageUrl = 'https://remotion.media/element-image.png';
const videoUrl = 'https://remotion.media/element-video.mp4';
Remote assets should be publicly accessible and stable.
When submitting an Element as a pull request, include:
packages/docs/elements/<category>/<slug>/index.mdx page and the single-file TSX source code in that folderThese are usually less suitable:
Submit Elements by opening a pull request against the Remotion repository.