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 building block inside a <Sequence>.
An Element should ideally be a single, self-contained TSX file.
Each Element should live in its own folder: packages/docs/elements/<category>/<slug>/.
Put the MDX page at packages/docs/elements/<category>/<slug>/index.mdx and the TSX source next to it.
Start from the reusable template in packages/docs/elements-template/.
The MDX page imports that TSX file for the live preview, and shows the exact same code in a fenced tsx code block. Keeping the displayed code inline means both readers in the browser and AI agents reading the served Markdown see the full source. A test (src/test/elements.test.ts) enforces that the code block stays identical to the source file.
The preferred format is:
width, height, fps, and durationInFrames<Composition> directly in the fileFor example:
import {Composition} from 'remotion';
export const width = 1920;
export const height = 1080;
export const fps = 30;
export const durationInFrames = 120;
export const MyElement = () => {
return <div>...</div>;
};
export const RemotionRoot = () => {
return (
<Composition
id="MyElement"
component={MyElement}
width={width}
height={height}
fps={fps}
durationInFrames={durationInFrames}
/>
);
};
The MDX page can then use the shared page template, which renders a preview, a "Use it" section, and the source code:
import {ElementPage} from '@site/src/components/Elements/ElementPage';
import {
MyElement,
durationInFrames,
fps,
height,
width,
} from './my-element';
<ElementPage
component={MyElement}
durationInFrames={durationInFrames}
fps={fps}
height={height}
width={width}
>
```tsx twoslash title="my-element.tsx"
// Paste the full contents of my-element.tsx here.
// It must match the file exactly — a test enforces this.
```
</ElementPage>
The fenced code block must be an exact copy of the colocated TSX file. This is intentional: it keeps the source visible in the served Markdown for agents while the imported module powers the live preview.
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';
A good Element is:
<Sequence>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.