🎥 Make videos programmatically with React
Elements: Merge contribution guides (#10446)
Igor Samokhovets339d35e9ebca
diff --git a/.agents/skills/accept-element/SKILL.md b/.agents/skills/accept-element/SKILL.mdindex c8be82708f..5a84c47a6b 100644--- a/.agents/skills/accept-element/SKILL.md+++ b/.agents/skills/accept-element/SKILL.md@@ -5,7 +5,7 @@ description: Accept an external Remotion Element contribution by verifying its c# Accept a Remotion Element-This is a maintainer-only workflow for contributions that used the external path in the [`submit-element` skill](../submit-element/SKILL.md). Do not use it for a repository writer's direct submission, which already has public preview URLs and no committed preview assets. Read the [Element Guidelines](../../../packages/docs/elements/guidelines.mdx), the [`scaffold-element` skill](../scaffold-element/SKILL.md), and the `submit-element` skill completely before making changes.+This is a maintainer-only workflow for contributions that used the external path in the [`submit-element` skill](../submit-element/SKILL.md). Do not use it for a repository writer's direct submission, which already has public preview URLs and no committed preview assets. Read the [Element contribution guide](../../../packages/docs/elements/contributing.mdx), the [`scaffold-element` skill](../scaffold-element/SKILL.md), and the `submit-element` skill completely before making changes.Run this workflow on the external contributor's pull request branch. Do not force push. For a pull request from a fork, confirm that “Allow edits from maintainers” is enabled. If the branch cannot be updated, upload only after approval and ask the contributor to apply the URL and asset cleanup described below.@@ -17,7 +17,7 @@ Identify the single submitted `<category>/<slug>` and confirm that:- The page frontmatter and central definition use `/elements/<category>-<slug>-preview.png` and `.mp4` review URLs.- The matching files are committed at `packages/docs/static/elements/<category>-<slug>-preview.png` and `.mp4`.- The contributor explicitly reviewed the Element in Studio and approved both committed preview assets.-- The pull request has passed code review against the Element Guidelines.+- The pull request has passed code review against the Element contribution guide.Do not accept an Element whose metadata already points to a missing `https://remotion.media` asset or whose review assets are available only outside the pull request.diff --git a/.agents/skills/scaffold-element/SKILL.md b/.agents/skills/scaffold-element/SKILL.mdindex 3da69d3730..9eba6e48df 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 with a correctly configured preview# Scaffold a Remotion Element-The source of truth for design and quality criteria is the [Element Guidelines](../../../packages/docs/elements/guidelines.mdx). Read them completely before making changes. If this skill and the guidelines diverge on acceptance criteria, follow the guidelines.+The source of truth for design and quality criteria is the [Element contribution guide](../../../packages/docs/elements/contributing.mdx). Read it completely before making changes. If this skill and the guide diverge on acceptance criteria, follow the guide.This skill owns the technical scaffolding workflow. Use the [`submit-element` skill](../submit-element/SKILL.md) when the Element is ready for the gallery.@@ -41,7 +41,7 @@ mv packages/docs/elements/<category>/<slug>/element.tsx \Adapt the copied `index.mdx` to the production pattern: import `elementDefinitions`, use its `'<category>/<slug>'` entry, and set `sourceFile="./<slug>.tsx"`.-Implement only enough of the component in the generated `<slug>.tsx` file to provide a visible starting point in the intended bounds. Follow the Element Guidelines for the component itself. When using Studio-editable controls, also follow the [interactivity best practices skill](../interactivity-best-practices/SKILL.md).+Implement only enough of the component in the generated `<slug>.tsx` file to provide a visible starting point in the intended bounds. Follow the Element contribution guide for the component itself. When using Studio-editable controls, also follow the [interactivity best practices skill](../interactivity-best-practices/SKILL.md).## 3. Register the development compositiondiff --git a/.agents/skills/submit-element/SKILL.md b/.agents/skills/submit-element/SKILL.mdindex 3a257f155a..e0d3cc941f 100644--- a/.agents/skills/submit-element/SKILL.md+++ b/.agents/skills/submit-element/SKILL.md@@ -5,7 +5,7 @@ description: Finalize a developed Remotion Element, add it to the docs gallery,# Submit a Remotion Element-The source of truth for design and quality criteria is the [Element Guidelines](../../../packages/docs/elements/guidelines.mdx). Read them completely before making changes. If this skill and the guidelines diverge on acceptance criteria, follow the guidelines.+The source of truth for design and quality criteria is the [Element contribution guide](../../../packages/docs/elements/contributing.mdx). Read it completely before making changes. If this skill and the guide diverge on acceptance criteria, follow the guide.This skill owns the contributor submission workflow. It starts with an Element created by the [`scaffold-element` skill](../scaffold-element/SKILL.md). Repository writers upload reviewed previews directly. Other contributors commit temporary review assets that a maintainer later processes with the [`accept-element` skill](../accept-element/SKILL.md).@@ -52,7 +52,7 @@ Use the **external contribution path** when the permission is `read`, `triage`,## 3. Perform the submission review-Review the finished source, MDX page, and central definition against the Element Guidelines and the technical requirements in the [`scaffold-element` skill](../scaffold-element/SKILL.md). Resolve placeholder content and finalize the description, display name, contributors, dimensions, duration, `installationMode`, declared dependencies, preview padding, and poster frame.+Review the finished source, MDX page, and central definition against the Element contribution guide and the technical requirements in the [`scaffold-element` skill](../scaffold-element/SKILL.md). Resolve placeholder content and finalize the description, display name, contributors, dimensions, duration, `installationMode`, declared dependencies, preview padding, and poster frame.Keep the local review URLs in place while rendering and reviewing:diff --git a/packages/docs/elements-sidebars.ts b/packages/docs/elements-sidebars.tsindex 5f0d1846dd..8b7ceaa4ec 100644--- a/packages/docs/elements-sidebars.ts+++ b/packages/docs/elements-sidebars.ts@@ -20,8 +20,7 @@ const compareStrings = (a: string, b: string) => {const sidebars: SidebarsConfig = {elementsSidebar: ['index',- 'guidelines',- 'submit-an-element',+ 'contributing',{type: 'html',value:diff --git a/packages/docs/elements/guidelines.mdx b/packages/docs/elements/contributing.mdxsimilarity index 68%rename from packages/docs/elements/guidelines.mdxrename to packages/docs/elements/contributing.mdxindex abfc8fab67..7cecfad99b 100644--- a/packages/docs/elements/guidelines.mdx+++ b/packages/docs/elements/contributing.mdx@@ -1,26 +1,28 @@----title: Element Guidelines-sidebar_label: Guidelines-description: Guidelines for creating useful, portable Remotion Elements.+title: Contributing an Element+sidebar_label: Contributing+description: Create and submit a Remotion Element for the Elements gallery.----# Element Guidelines+# Contributing an Element++## Element GuidelinesA Remotion Element should be a focused, reusable video building block that can be copied and remixed.-## Use real videos as references+### Use real videos as referencesStart with a technique from a published video. Save its link and timestamp, then identify the reusable purpose—for example, emphasizing a phrase or introducing a speaker.Web components, Remotion libraries, and AI-generated ideas may help with implementation, but they are not evidence that an idea works in a video. Create an original visual treatment; do not copy branding, footage, or proprietary assets.-## Keep it focused+### Keep it focusedAn Element should represent one coherent visual treatment, technique, or workflow. It should work without configuration and be useful across projects.The caption Elements show the distinction: moving a pill between words, popping words, and highlighting words all serve the same purpose but use distinct visual techniques that users would choose separately. Do not create Elements for arbitrary presets, minor CSS differences, or Studio-control configurations.-## Make it portable+### Make it portable- Keep the implementation self-contained, using HTML, CSS, and React where possible.- Avoid global styles, layout side effects, and fullscreen assumptions unless the Element is a background.@@ -29,7 +31,7 @@ The caption Elements show the distinction: moving a pill between words, popping- Minimize dependencies. [Remotion Effects](/docs/effects) are an acceptable exception.- Declare every external dependency in the central Element definition, except `react`, `react-dom`, and `remotion`. Every non-Remotion package must use an exact semantic version; version ranges and tags are not accepted. Remotion packages use `version: null` and are installed at the project's Remotion version.-## Design it for composition+### Design it for compositionSize the Element to its smallest useful bounding box. By default, let the [`<Sequence>`](/docs/sequence) generated during installation control its placement and duration. Set both dimensions to `null` if it adapts to the composition.@@ -37,7 +39,7 @@ An Element that already owns the one interactive Sequence users should edit mayDo not use the component-owned mode merely to remove markup: The Element needs to remain movable and trimmable through its component-owned Sequence. Do not add internal padding only to improve the gallery preview.-## Animate temporary Elements in and out+### Animate temporary Elements in and outIf an Element is intended to appear temporarily over other content—such as an overlay, lower third, label, or callout—include both an entrance and an exit animation.@@ -45,7 +47,7 @@ Backgrounds, loops, full-scene treatments, and other Elements that are not expecAnimate properties within the Element, such as translation, scale, and opacity; leave placement to the generated wrapper or the component-owned Sequence.-## Expose useful Studio controls+### Expose useful Studio controlsUse Studio controls in the Element's `Interactive` schema, not React props on its public component, for user-facing customization. Expose only controls that meaningfully edit the treatment; they may tune details but must not switch between unrelated visual styles.@@ -53,8 +55,36 @@ Give editable objects clear names, using a generic name such as `Container` forFollow the [interactivity best practices](/docs/studio/interactivity-best-practices).-## Choose a representative preview+### Choose a representative previewChoose 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.-When ready, [submit the Element](/elements/submit-an-element).+When ready, [submit the Element](#submit-an-element).++## Submit an Element++Have a small, remixable Remotion Element? We'd like to see it.++Before starting, read the [Element Guidelines](#element-guidelines). They describe the design and quality criteria for Elements.++### Use the Agent Skills++Two [Agent Skills](https://agentskills.io/) define the contribution workflow:++- Use the [`scaffold-element` Agent Skill](https://github.com/remotion-dev/remotion/blob/main/.agents/skills/scaffold-element/SKILL.md) to create the repository files and development composition.+- Use the [`submit-element` Agent Skill](https://github.com/remotion-dev/remotion/blob/main/.agents/skills/submit-element/SKILL.md) after reviewing the Element in Remotion Studio. It adds the Element to the gallery and prepares it for review.++Ask your coding agent to use the skills in that order.++### Open the pull request++When submitting an Element as a pull request, include:++- The Element implementation, page, and gallery registration+- What makes it useful+- A working PNG and MP4 preview+- Links to inspiration, if any++The submission skill prepares the previews so they work in the pull request deployment. Keep “Allow edits from maintainers” enabled on the pull request.++[Open a pull request on GitHub](https://github.com/remotion-dev/remotion/compare)diff --git a/packages/docs/elements/index.mdx b/packages/docs/elements/index.mdxindex 8eeb821f0c..354d05770c 100644--- a/packages/docs/elements/index.mdx+++ b/packages/docs/elements/index.mdx@@ -14,4 +14,4 @@ Remotion Elements are drop-in, HTML-first video building blocks. Send one from t<div style={{height: 24}} />-To contribute, follow the [Element Guidelines](/elements/guidelines) and [submission instructions](/elements/submit-an-element).+To contribute, read the [Element contribution guide](/elements/contributing).diff --git a/packages/docs/elements/submit-an-element.mdx b/packages/docs/elements/submit-an-element.mdxdeleted file mode 100644index a341c24402..0000000000--- a/packages/docs/elements/submit-an-element.mdx+++ /dev/null@@ -1,32 +0,0 @@-----title: Submit an Element-description: Submit a Remotion Element for the Elements gallery.------# Submit an Element--Have a small, remixable Remotion Element? We'd like to see it.--Before starting, read the [Element Guidelines](/elements/guidelines). They describe the design and quality criteria for Elements.--## Use the Agent Skills--Two [Agent Skills](https://agentskills.io/) define the contribution workflow:--- Use the [`scaffold-element` Agent Skill](https://github.com/remotion-dev/remotion/blob/main/.agents/skills/scaffold-element/SKILL.md) to create the repository files and development composition.-- Use the [`submit-element` Agent Skill](https://github.com/remotion-dev/remotion/blob/main/.agents/skills/submit-element/SKILL.md) after reviewing the Element in Remotion Studio. It adds the Element to the gallery and prepares it for review.--Ask your coding agent to use the skills in that order.--## Open the pull request--When submitting an Element as a pull request, include:--- The Element implementation, page, and gallery registration-- What makes it useful-- A working PNG and MP4 preview-- Links to inspiration, if any--The submission skill prepares the previews so they work in the pull request deployment. Keep “Allow edits from maintainers” enabled on the pull request.--[Open a pull request on GitHub](https://github.com/remotion-dev/remotion/compare)diff --git a/packages/docs/src/test/elements.test.ts b/packages/docs/src/test/elements.test.tsindex f277d9b82b..b919680072 100644--- a/packages/docs/src/test/elements.test.ts+++ b/packages/docs/src/test/elements.test.ts@@ -312,10 +312,9 @@ describe('Elements sidebar', () => {throw new Error('Elements sidebar must be an array');}- expect(sidebar.slice(0, 4)).toEqual([+ expect(sidebar.slice(0, 3)).toEqual(['index',- 'guidelines',- 'submit-an-element',+ 'contributing',{type: 'html',value:@@ -324,7 +323,7 @@ describe('Elements sidebar', () => {},]);- const categories = sidebar.slice(4);+ const categories = sidebar.slice(3);const expectedCategories = [{category: 'backgrounds',diff --git a/packages/docs/vercel.ts b/packages/docs/vercel.tsindex 40c57dd999..660d8200b6 100644--- a/packages/docs/vercel.ts+++ b/packages/docs/vercel.ts@@ -47,6 +47,26 @@ export const config: VercelConfig = {]),],redirects: [+ routes.redirect(+ '/elements/guidelines',+ '/elements/contributing#element-guidelines',+ {permanent: true},+ ),+ routes.redirect(+ '/elements/guidelines.md',+ '/elements/contributing.md#element-guidelines',+ {permanent: true},+ ),+ routes.redirect(+ '/elements/submit-an-element',+ '/elements/contributing#submit-an-element',+ {permanent: true},+ ),+ routes.redirect(+ '/elements/submit-an-element.md',+ '/elements/contributing.md#submit-an-element',+ {permanent: true},+ ),routes.redirect('/elements/overlays/lower-third','/elements/overlays/name-lower-third',