Skip to content

🎥 Make videos programmatically with React

Elements: Separate guidelines from gallery contribution guide

Igor Samokhovets40552e5a04c6
diff --git a/packages/docs/docs/studio-protocol/component-library-integration.mdx b/packages/docs/docs/studio-protocol/component-library-integration.mdx
index 693a39ab6d..2e44ac400d 100644
--- a/packages/docs/docs/studio-protocol/component-library-integration.mdx
+++ b/packages/docs/docs/studio-protocol/component-library-integration.mdx
@@ -11,7 +11,7 @@ An Element contains the source code for one component. It also contains the data
Studio writes the source code to an `.element.tsx` file. Studio installs only the packages in the Element's `dependencies` list. You do not have to publish or install the Element Library in the target project.
-A component that follows the [Element guidelines](/elements/contributing#element-guidelines) is usually ready for Studio.
+A component that follows the [Element guidelines](/elements/guidelines) is usually ready for Studio.
Use this procedure to preview and deliver a component:
@@ -114,7 +114,7 @@ When Studio embeds the library through Browse Elements, use [`isInsideStudio()`]
## See also
- [Third-party Element Libraries](/elements/libraries)
-- [Element guidelines](/elements/contributing#element-guidelines)
+- [Element guidelines](/elements/guidelines)
- [`<Player>`](/docs/player)
- [`createElementPayload()`](/docs/studio-protocol/create-element-payload)
- [`staticFileRef()`](/docs/studio-protocol/static-file-ref)
diff --git a/packages/docs/docs/studio-protocol/create-element-payload.mdx b/packages/docs/docs/studio-protocol/create-element-payload.mdx
index 56cc5a2b21..10e51c0dfb 100644
--- a/packages/docs/docs/studio-protocol/create-element-payload.mdx
+++ b/packages/docs/docs/studio-protocol/create-element-payload.mdx
@@ -115,7 +115,7 @@ With `'wrapped'`, Studio generates a [`<Sequence>`](/docs/sequence) around the c
With `'component-owned-sequence'`, Studio puts timing, name, and absolute positioning props on the component call without adding an outer Sequence. The component must provide its own Studio-editable Sequence and rendered dimensions.
-See [Design it for composition](/elements/contributing#design-it-for-composition) for guidance on choosing a mode and wiring the component.
+See [Design it for composition](/elements/guidelines#design-it-for-composition) for guidance on choosing a mode and wiring the component.
## Return value
diff --git a/packages/docs/elements-sidebars.ts b/packages/docs/elements-sidebars.ts
index 0fc797416b..4df05bba36 100644
--- a/packages/docs/elements-sidebars.ts
+++ b/packages/docs/elements-sidebars.ts
@@ -54,6 +54,7 @@ const sidebars: SidebarsConfig = {
'<hr style="margin-top: 4px; margin-bottom: 4px; border-bottom: none"/>',
defaultStyle: true,
},
+ 'guidelines',
'libraries',
],
},
diff --git a/packages/docs/elements/contributing.mdx b/packages/docs/elements/contributing.mdx
index 1990c79a6a..35c38634f3 100644
--- a/packages/docs/elements/contributing.mdx
+++ b/packages/docs/elements/contributing.mdx
@@ -6,7 +6,7 @@ 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.
+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
@@ -20,6 +20,12 @@ 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 [Element guidelines](/elements/guidelines#make-it-portable).
+
+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`.
+
## 2. Prepare previews
Render and visually review the Element and its previews:
@@ -52,96 +58,3 @@ Include:
- 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.
-
-## Element Guidelines
-
-A Remotion Element should be a focused, reusable video building block that can be copied and remixed.
-
-### Use real videos as references
-
-Start 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
-
-An 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
-
-- 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.
-- Set explicit defaults for inherited visual properties. In particular, set text colors on the Element root or the nearest visual surface instead of relying on browser or host-page defaults. Ensure every use of `currentColor` resolves from an ancestor with an explicit color so the Element looks the same under light and dark host themes.
-- [Include assets](#include-assets) that should be copied into the user's project. Use Google Fonts for non-websafe fonts.
-- Avoid project-specific branding or footage, and make colors easy to change.
-- 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
-
-Prefer exposing the Element's layers so users can inspect and edit them with [Studio interactivity](/docs/studio/interactivity). Use one of the following installation modes based on what the user should see in Studio.
-
-#### Separate editable layers
-
-Use `installationMode: 'wrapped'` when the Element's layers can be edited separately. This is the default mode. Studio wraps the component in a [`<Sequence>`](/docs/sequence) for placement and duration. The top-level group may expose multiple child timeline rows. Editable values can stay on internal `Interactive` call sites in the copied source, where Studio edits them.
-
-Size the Element to its smallest useful bounding box. If it adapts to the composition, set both dimensions to `null`.
-
-#### One interactive object
-
-Use `installationMode: 'component-owned-sequence'` when Studio interactivity does not make sense for the Element's internal parts. Examples include:
-
-- Generative programmed effects
-- Canvas-based Elements where individual outlines cannot be passed to Studio
-- Single-image overlays where the image itself cannot be edited
-
-Wrap the exported component with [`Interactive.withSchema()`](/docs/interactive-with-schema). The user gets one timeline layer that they can move on the canvas and trim in the timeline. The implementation does not appear as separate editable layers.
-
-Export the schema-enabled component directly and wire up the common props:
-
-- Add [`Interactive.baseSchema`](/docs/interactive#interactivebaseschema) to every `Interactive.withSchema()` schema and pass `controls` unchanged to the component's `<Sequence>`.
-- Pass `from`, `durationInFrames`, `trimBefore`, `playbackRate`, `freeze`, `hidden`, `name`, and `showInTimeline` to that Sequence.
-- Pass `style` and the ref to the rendered outline. When the Sequence uses `layout="none"`, pass [`outlineRef`](/docs/sequence#outlineref) to it. Set the dimensions in the component because Element metadata does not pass them as props.
-- Render frame-dependent animation in a child below the Sequence. This makes [`useCurrentFrame()`](/docs/use-current-frame) respect `from`, `trimBefore`, `playbackRate`, and `freeze`. If the component that returns the Sequence calls it, it reads the parent clock.
-
-Export the schema-enabled component directly, without a forwarding wrapper. See the [oscilloscope](/elements/audio/oscilloscope), [waveform progress](/elements/audio/waveform-progress), and [mirrored spectrum](/elements/audio/mirrored-spectrum) Elements.
-
-Check in Studio that the exported instance appears as one layer and can be moved and trimmed. Do not use `component-owned-sequence` only to remove markup. Do not add padding only for the gallery preview.
-
-### Initial props
-
-If the Element needs starter props, put them in `initial-props.ts`, type them with `satisfies ComponentProps<typeof YourComponent>`, and register them as [`initialProps`](/docs/studio-protocol/create-element-payload#initialprops) in `element-definitions.ts`. For `component-owned-sequence`, this can provide defaults for Inspector controls. Otherwise, users can edit the installed source directly.
-
-### Include assets
-
-Follow the [asset integration guidance](/docs/studio-protocol/component-library-integration#preview-installed-assets). Installed assets are separate from the PNG and MP4 gallery previews in [Prepare previews](#2-prepare-previews).
-
-In `element-definitions.ts`, declare `assets` and put [`staticFileRef()`](/docs/studio-protocol/static-file-ref) references in `installationProps`. Keep preview URLs in `initialProps`.
-
-`installationProps` shallowly overrides `initialProps` only for installation; an overridden object or array replaces that entire prop. For Elements without installed assets, use `assets: []` and `installationProps: null`.
-
-### Animate temporary Elements in and out
-
-If 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.
-
-Backgrounds, loops, full-scene treatments, and other Elements that are not expected to enter and leave independently do not need these animations.
-
-Animate 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
-
-Elements are source-code copies designed for direct editing, not managed dependencies. Expose useful Studio controls in the Element's `Interactive` schema, but there is no need to mirror every implementation detail as a public prop.
-
-Use [`Interactive.withSchema()`](/docs/interactive-with-schema) when useful controls can make the Element easier to edit. Controls should meaningfully edit the treatment; they may tune details but must not switch between unrelated visual styles.
-
-Give editable objects clear names, using a generic name such as `Container` for the main object and child controls only for separate editing targets.
-
-Follow the [interactivity best practices](/docs/studio/interactivity-best-practices).
-
-### Choose a representative preview
-
-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.
-
-When ready, [open a pull request](#3-open-the-pull-request).
diff --git a/packages/docs/elements/guidelines.mdx b/packages/docs/elements/guidelines.mdx
new file mode 100644
index 0000000000..11c1af31de
--- /dev/null
+++ b/packages/docs/elements/guidelines.mdx
@@ -0,0 +1,98 @@
+---
+title: Element Guidelines
+sidebar_label: Guidelines
+description: Design reusable Remotion Elements for any Element library.
+---
+
+# Element Guidelines
+
+A Remotion Element should be a focused, reusable video building block that can be copied and remixed.
+
+## Use real videos as references
+
+Start 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
+
+An 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
+
+- 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.
+- Set explicit defaults for inherited visual properties. In particular, set text colors on the Element root or the nearest visual surface instead of relying on browser or host-page defaults. Ensure every use of `currentColor` resolves from an ancestor with an explicit color so the Element looks the same under light and dark host themes.
+- [Include assets](#include-assets) that should be copied into the user's project. Use Google Fonts for non-websafe fonts.
+- Avoid project-specific branding or footage, and make colors easy to change.
+- Minimize dependencies. [Remotion Effects](/docs/effects) are an acceptable exception.
+- Declare every external dependency in the Element library's metadata, 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. See the [Studio protocol's `dependencies` field](/docs/studio-protocol/create-element-payload#dependencies).
+
+## Design it for composition
+
+Prefer exposing the Element's layers so users can inspect and edit them with [Studio interactivity](/docs/studio/interactivity). Use one of the following installation modes based on what the user should see in Studio.
+
+### Separate editable layers
+
+Use `installationMode: 'wrapped'` when the Element's layers can be edited separately. This is the default mode. Studio wraps the component in a [`<Sequence>`](/docs/sequence) for placement and duration. The top-level group may expose multiple child timeline rows. Editable values can stay on internal `Interactive` call sites in the copied source, where Studio edits them.
+
+Size the Element to its smallest useful bounding box. If it adapts to the composition, set both dimensions to `null`.
+
+### One interactive object
+
+Use `installationMode: 'component-owned-sequence'` when Studio interactivity does not make sense for the Element's internal parts. Examples include:
+
+- Generative programmed effects
+- Canvas-based Elements where individual outlines cannot be passed to Studio
+- Single-image overlays where the image itself cannot be edited
+
+Wrap the exported component with [`Interactive.withSchema()`](/docs/interactive-with-schema). The user gets one timeline layer that they can move on the canvas and trim in the timeline. The implementation does not appear as separate editable layers.
+
+Export the schema-enabled component directly and wire up the common props:
+
+- Add [`Interactive.baseSchema`](/docs/interactive#interactivebaseschema) to every `Interactive.withSchema()` schema and pass `controls` unchanged to the component's `<Sequence>`.
+- Pass `from`, `durationInFrames`, `trimBefore`, `playbackRate`, `freeze`, `hidden`, `name`, and `showInTimeline` to that Sequence.
+- Pass `style` and the ref to the rendered outline. When the Sequence uses `layout="none"`, pass [`outlineRef`](/docs/sequence#outlineref) to it. Set the dimensions in the component because Element metadata does not pass them as props.
+- Render frame-dependent animation in a child below the Sequence. This makes [`useCurrentFrame()`](/docs/use-current-frame) respect `from`, `trimBefore`, `playbackRate`, and `freeze`. If the component that returns the Sequence calls it, it reads the parent clock.
+
+Export the schema-enabled component directly, without a forwarding wrapper. See the [oscilloscope](/elements/audio/oscilloscope), [waveform progress](/elements/audio/waveform-progress), and [mirrored spectrum](/elements/audio/mirrored-spectrum) Elements.
+
+Check in Studio that the exported instance appears as one layer and can be moved and trimmed. Do not use `component-owned-sequence` only to remove markup. Do not add padding only for a gallery preview.
+
+## Initial props
+
+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.
+
+## Include assets
+
+Follow the [asset integration guidance](/docs/studio-protocol/component-library-integration#preview-installed-assets). Installed assets are separate from gallery previews.
+
+Declare installed assets in the library metadata and use [`staticFileRef()`](/docs/studio-protocol/static-file-ref) references in `installationProps`. Keep preview URLs in `initialProps`.
+
+`installationProps` shallowly overrides `initialProps` only for installation; an overridden object or array replaces that entire prop.
+
+## Animate temporary Elements in and out
+
+If 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.
+
+Backgrounds, loops, full-scene treatments, and other Elements that are not expected to enter and leave independently do not need these animations.
+
+Animate 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
+
+Elements are source-code copies designed for direct editing, not managed dependencies. Expose useful Studio controls in the Element's `Interactive` schema, but there is no need to mirror every implementation detail as a public prop.
+
+Use [`Interactive.withSchema()`](/docs/interactive-with-schema) when useful controls can make the Element easier to edit. Controls should meaningfully edit the treatment; they may tune details but must not switch between unrelated visual styles.
+
+Give editable objects clear names, using a generic name such as `Container` for the main object and child controls only for separate editing targets.
+
+Follow the [interactivity best practices](/docs/studio/interactivity-best-practices).
+
+## Choose a representative preview
+
+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.
+
+To submit an Element to the official gallery, read the [contribution guide](/elements/contributing).
diff --git a/packages/docs/elements/libraries.mdx b/packages/docs/elements/libraries.mdx
index 88633dd883..bd64bfd63c 100644
--- a/packages/docs/elements/libraries.mdx
+++ b/packages/docs/elements/libraries.mdx
@@ -12,7 +12,7 @@ This is a list of third-party websites providing Remotion [Elements](/elements).
Click **Add to Studio** to register libraries in your project so you can quickly access them from Remotion Studio.
-Anybody can create Element Libraries. Click [here](/docs/studio-protocol/component-library-integration) for instructions.
+Anybody can create Element Libraries. Follow the [Element guidelines](/elements/guidelines) when designing Elements, then read the [library integration guide](/docs/studio-protocol/component-library-integration) for instructions.
Contact [[email protected]](mailto:[email protected]) to propose inclusion of your Element Library on this page.
diff --git a/packages/docs/vercel.ts b/packages/docs/vercel.ts
index 3bed690c39..4b60062061 100644
--- a/packages/docs/vercel.ts
+++ b/packages/docs/vercel.ts
@@ -51,16 +51,6 @@ export const config: VercelConfig = {
],
redirects: [
routes.redirect('/experimental_new', '/new', {permanent: true}),
- 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',