Skip to content

🎥 Make videos programmatically with React

Docs: Simplify Element contribution guide

Igor Samokhovetscad50464562e
diff --git a/.agents/skills/pr/SKILL.md b/.agents/skills/pr/SKILL.md
index 49936c3dd3..d2af3315ff 100644
--- a/.agents/skills/pr/SKILL.md
+++ b/.agents/skills/pr/SKILL.md
@@ -8,7 +8,7 @@ Check whether a PR already exists for the current branch with `gh pr status` or
Keep new agent-authored tests, including new test cases in existing files, out of the PR unless the user explicitly requested them. Updates to existing tests, fixtures, and snapshots are allowed when needed for the change. Review the diff and preserve pre-existing user changes.
-If the changes add a Remotion Element, read the [Element contribution guide](../../../packages/docs/elements/contributing.mdx) before continuing.
+If the changes add a Remotion Element, read the [Element contribution guide](../../../packages/docs/docs/contributing/elements.mdx) before continuing.
Run Oxfmt on the files or package directories affected by the current change. Pass their actual paths; do not assume that the repository root has a `src` directory. Include relevant root-level files, and do not format unrelated packages or the whole repository.
diff --git a/.agents/skills/scaffold-element/SKILL.md b/.agents/skills/scaffold-element/SKILL.md
index 69807126e5..93d65dd46a 100644
--- a/.agents/skills/scaffold-element/SKILL.md
+++ b/.agents/skills/scaffold-element/SKILL.md
@@ -5,7 +5,7 @@ description: Scaffold a new Remotion Element for development in the docs Remotio
# Scaffold a Remotion Element
-Read the [Element guidelines](../../../packages/docs/elements/guidelines.mdx) for design and implementation guidance and the [Element contribution guide](../../../packages/docs/elements/contributing.mdx) for the official gallery submission process. Then follow its [Develop the Element](../../../packages/docs/elements/contributing.mdx#1-develop-the-element) section.
+Read the [Element guidelines](../../../packages/docs/elements/guidelines.mdx) for design and implementation guidance and the [Element contribution guide](../../../packages/docs/docs/contributing/elements.mdx) for the official gallery submission process. Then follow its [Develop the Element](../../../packages/docs/docs/contributing/elements.mdx#1-develop-the-element) section.
After scaffolding, suggest opening Docs Studio to preview the Element. If the user agrees, start it without opening a browser automatically:
diff --git a/packages/docs/docs/contributing/elements.mdx b/packages/docs/docs/contributing/elements.mdx
new file mode 100644
index 0000000000..775f2f62dc
--- /dev/null
+++ b/packages/docs/docs/contributing/elements.mdx
@@ -0,0 +1,50 @@
+---
+image: /generated/articles-docs-contributing-elements.png
+title: Contributing an Element
+sidebar_label: Contributing an Element
+crumb: Contributing
+description: Create and submit a Remotion Element for the Elements gallery.
+---
+
+# Contributing an Element
+
+First, [set up the repository](/docs/contributing).
+
+Use your AI coding agent to build an Element. Give it this page and the [Element guidelines](/elements/guidelines).
+
+## 1. Develop the Element
+
+Use any [existing Element](https://github.com/remotion-dev/remotion/tree/main/packages/docs/elements) as a reference. For example, give your agent this prompt:
+
+```text title="Example prompt"
+Create a dotted paper background Element.
+Use the notebook paper Element as a reference.
+```
+
+See the guidelines for [dependencies](/elements/guidelines#dependencies), [assets](/elements/guidelines#assets), and [initial props](/elements/guidelines#initial-props).
+
+Open Studio to check the animation:
+
+```bash title="Terminal"
+cd packages/docs
+bun remotion
+```
+
+## 2. Prepare previews
+
+Ask your agent to render previews and run the tests. For the example above, run these commands from `packages/docs`:
+
+```bash title="Terminal"
+bun run render-element-previews --element=backgrounds/dotted-paper
+bun test src/test/elements.test.ts
+```
+
+Review the PNG and MP4 files in `.element-previews/backgrounds/dotted-paper`. Choose a clear poster frame and check the full animation.
+
+Ask your agent to include the preview files in the pull request and use them on the Element page.
+
+## 3. Open the pull request
+
+Submit the Element and its previews. Include links to any source of inspiration.
+
+Keep “Allow edits from maintainers” enabled. After approval, a maintainer uploads the previews to static storage.
diff --git a/packages/docs/elements-sidebars.ts b/packages/docs/elements-sidebars.ts
index 0168a67bc6..a6f95e5801 100644
--- a/packages/docs/elements-sidebars.ts
+++ b/packages/docs/elements-sidebars.ts
@@ -29,8 +29,9 @@ const sidebars: SidebarsConfig = {
collapsed: false,
items: [
{
- type: 'doc',
- id: 'contributing',
+ type: 'link',
+ label: 'Contribute an Element',
+ href: '/docs/contributing/elements',
className: 'elements-sidebar-standalone-only',
},
{
diff --git a/packages/docs/elements/contributing.mdx b/packages/docs/elements/contributing.mdx
deleted file mode 100644
index 47eaa1903e..0000000000
--- a/packages/docs/elements/contributing.mdx
+++ /dev/null
@@ -1,62 +0,0 @@
----
-title: Contributing an Element
-sidebar_label: Contributing
-description: Create and submit a Remotion Element for the Elements gallery.
----
-
-# Contributing an Element
-
-Have a small, remixable Remotion Element? We'd like to see it. Before submitting, read the [Element guidelines](/elements/guidelines). They apply to Elements in the official gallery and third-party libraries alike.
-
-## 1. Develop the Element
-
-1. Copy `packages/docs/elements-template` to `packages/docs/elements/<category>/<slug>`. The template includes a component and an `index.mdx` documentation page.
-2. Add its metadata to `packages/docs/src/components/Elements/element-definitions.ts` to register its Studio composition, and add its page to `packages/docs/elements-sidebars.ts`.
-3. Build and preview the Element in Studio:
-
-```bash title="Terminal"
-cd packages/docs && bun remotion
-```
-
-The **scaffold-element skill** is an [Agent Skill](https://agentskills.io/) that can set up the template and Studio composition.
-
-Declare the Element's dependencies in `element-definitions.ts` as described in the [`dependencies` field](/docs/studio-protocol/create-element-payload#dependencies).
-
-If the Element needs starter props, put them in `initial-props.ts`, type them with `satisfies ComponentProps<typeof YourComponent>`, and register them as `initialProps` in `element-definitions.ts`.
-
-For installed assets, declare `assets` in `element-definitions.ts` and put `staticFileRef()` references in `installationProps`. Keep preview URLs in `initialProps`. For Elements without installed assets, use `assets: []` and `installationProps: null`. `installationProps` shallowly overrides `initialProps` only for installation; an overridden object or array replaces that entire prop.
-
-## 2. Prepare previews
-
-Choose a poster frame that clearly shows the Element. The video preview should cover the Element's full duration and, when applicable, include its entrance and exit animations.
-
-Render and visually review the Element and its previews:
-
-```bash title="Terminal"
-cd packages/docs
-bun run render-element-previews --element=<category>/<slug>
-bun test src/test/elements.test.ts
-```
-
-To make previews visible in the pull request deployment:
-
-1. Copy the rendered preview assets to `packages/docs/static/elements` and commit them.
-2. Set `image`, `posterUrl`, and `videoUrl` to `/elements/<category>-<slug>-preview.png` and `/elements/<category>-<slug>-preview.mp4`, matching those files.
-
-{/*
-Preview workflows:
-
-- External contributors render previews, commit them to static/elements, and use local URLs so the pull request deployment can show them.
-- Maintainers can use the upload-element-previews skill after rendering locally (source=render) or from a contributor's committed assets (source=submission). The uploader verifies the assets, publishes them to unique remotion.media URLs, and prints the replacements. Delete the static review assets after a submission upload.
-*/}
-
-## 3. Open the pull request
-
-Include:
-
-- The implementation, page, and gallery registration
-- What makes it useful
-- A working PNG and MP4 preview
-- Links to inspiration, if any
-
-Keep “Allow edits from maintainers” enabled on the pull request. After approval, a repository maintainer uploads the gallery previews to static storage.
diff --git a/packages/docs/elements/guidelines.mdx b/packages/docs/elements/guidelines.mdx
index 4669609636..785531d041 100644
--- a/packages/docs/elements/guidelines.mdx
+++ b/packages/docs/elements/guidelines.mdx
@@ -73,4 +73,4 @@ Give editable objects clear names. Use a generic name such as `Container` for th
If the Element needs starter props, provide [`initialProps`](/docs/studio-protocol/create-element-payload#initialprops) in its library metadata. For `component-owned-sequence`, this can provide defaults for Inspector controls. Otherwise, users can edit the installed source directly.
-To submit an Element to the official gallery, read the [contribution guide](/elements/contributing).
+To submit an Element to the official gallery, read the [contribution guide](/docs/contributing/elements).
diff --git a/packages/docs/elements/index.mdx b/packages/docs/elements/index.mdx
index 92a5eec60e..2ec3acd4d9 100644
--- a/packages/docs/elements/index.mdx
+++ b/packages/docs/elements/index.mdx
@@ -21,4 +21,4 @@ Browse the catalog here or [directly inside Remotion Studio](/docs/studio/browse
Add [third-party Element Libraries](/elements/libraries) to browse and install Elements from other creators in Studio.
-To contribute, read the [Element contribution guide](/elements/contributing).
+To contribute, read the [Element contribution guide](/docs/contributing/elements).
diff --git a/packages/docs/sidebars.ts b/packages/docs/sidebars.ts
index 261f878057..8ee1dd1311 100644
--- a/packages/docs/sidebars.ts
+++ b/packages/docs/sidebars.ts
@@ -1775,6 +1775,7 @@ const sidebars: SidebarsConfig = {
'contributing/web-renderer',
'contributing/presentation',
'contributing/sfx',
+ 'contributing/elements',
'authoring-packages',
],
},
diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.ts
index ee130065fc..450fefc057 100644
--- a/packages/docs/src/data/articles.ts
+++ b/packages/docs/src/data/articles.ts
@@ -2925,6 +2925,15 @@ export const articles = [
noAi: false,
slug: 'contributing/docs',
},
+ {
+ id: 'contributing/elements',
+ title: 'Contributing an Element',
+ relativePath: 'docs/contributing/elements.mdx',
+ compId: 'articles-docs-contributing-elements',
+ crumb: 'Contributing',
+ noAi: false,
+ slug: 'contributing/elements',
+ },
{
id: 'contributing/feature',
title: 'Implementing a new feature',
diff --git a/packages/docs/static/generated/articles-docs-contributing-elements.png b/packages/docs/static/generated/articles-docs-contributing-elements.png
new file mode 100644
index 0000000000..2adac01084
Binary files /dev/null and b/packages/docs/static/generated/articles-docs-contributing-elements.png differ
diff --git a/packages/docs/vercel.ts b/packages/docs/vercel.ts
index 86f71c81de..06dca2c23f 100644
--- a/packages/docs/vercel.ts
+++ b/packages/docs/vercel.ts
@@ -90,14 +90,22 @@ export const config: VercelConfig = {
permanent: true,
}),
routes.redirect('/experimental_new', '/new', {permanent: true}),
+ routes.redirect('/elements/contributing', '/docs/contributing/elements', {
+ permanent: true,
+ }),
+ routes.redirect(
+ '/elements/contributing.md',
+ '/docs/contributing/elements.md',
+ {permanent: true},
+ ),
routes.redirect(
'/elements/submit-an-element',
- '/elements/contributing#submit-an-element',
+ '/docs/contributing/elements',
{permanent: true},
),
routes.redirect(
'/elements/submit-an-element.md',
- '/elements/contributing.md#submit-an-element',
+ '/docs/contributing/elements.md',
{permanent: true},
),
routes.redirect(