🎥 Make videos programmatically with React
Elements: Streamline overview and guidelines (#10091)
Igor Samokhovets80d4cd8e896b
diff --git a/packages/docs/elements/guidelines.mdx b/packages/docs/elements/guidelines.mdxindex c36e92bac4..312567fede 100644--- a/packages/docs/elements/guidelines.mdx+++ b/packages/docs/elements/guidelines.mdx@@ -6,73 +6,49 @@ description: Guidelines for creating useful, portable Remotion Elements.# Element Guidelines-A Remotion Element should be a focused, reusable video building block that can be copied into a project and remixed.--Use these guidelines when designing and reviewing an Element.+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 visual technique observed in a published video, such as a YouTube video, TikTok, or Instagram Reel. Save a link and timestamp, and identify precisely what is worth turning into an Element.--**Do not use web components, other Remotion libraries, or AI-generated ideas as the source of the concept.** They may help with implementation, but they do not demonstrate that a visual idea works in a real video.+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.-Treat references as evidence of a useful video-making need, not as designs to reproduce. Identify the role the technique plays—for example, emphasizing a phrase or introducing a speaker—then design an original Element for that role. Do not copy the source's visual treatment, branding, footage, or proprietary assets.+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 in more than one Remotion project without becoming a complete, highly specific composition.--Do not use React props on the public Element component as its user-facing customization API. Expose meaningful customization through Studio controls declared in the Element's `Interactive` schema. Controls may adjust colors, intensity, animation amount, spacing, and minor layout choices when these options make the treatment meaningfully editable, but they should not change its core visual identity.--Do not use a Studio control to switch between unrelated visual treatments merely to combine multiple gallery ideas. Create separate Elements only when each treatment:--- represents a distinct visual technique or user intent;-- deserves an independent name and preview;-- is independently discoverable and useful; and-- would reasonably be selected separately from the gallery.+An Element should represent one coherent visual treatment, technique, or workflow. It should work without configuration and be useful across projects.-Sharing an underlying algorithm or workflow does not automatically make two Elements duplicates. Do not create separate Elements for arbitrary presets, minor CSS differences, or every possible Studio-control configuration. Only expose Studio controls that make the Element meaningfully editable.--The Elements gallery provides preview dimensions, frame rate, and duration. The `durationInFrames` value is used both for the preview and for the `<Sequence>` inserted into Studio.+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-An Element should work when it is dragged or copied into another project.--- Keep the implementation self-contained.-- Prefer HTML, CSS, and React.-- Avoid unexpected global styles and layout side effects.-- Avoid fullscreen assumptions unless the Element is a background.-- Use stable remote URLs for assets and Google Fonts for non-websafe fonts.+- 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.+- Use stable remote asset URLs and Google Fonts for non-websafe fonts.- Avoid project-specific branding or footage, and make colors easy to change.-- Avoid dependencies where possible. [Remotion Effects](/docs/effects) are an acceptable exception.-- Declare packages that Studio may need to install, but do not declare `react`, `react-dom`, or `remotion`; every Remotion project already provides them.-- Declare every external dependency in the central Element definition. Use an exact version only when a non-Remotion package requires one. Remotion packages use the project's installed Remotion version.+- 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`. Use exact non-Remotion versions only when required; Remotion packages use the project's installed version.## Design it for composition-An Element should be safe to combine with other content using normal Studio layering.+Size the Element to its smallest useful bounding box. Let the surrounding [`<Sequence>`](/docs/sequence) control its placement and duration. Set both dimensions to `null` if it adapts to the composition.-Size it to the smallest useful bounding box. Let the surrounding [`<Sequence>`](/docs/sequence) control its placement and how long it appears in the video. Set both Element dimensions to `null` when it adapts to the composition.--Do not add internal padding solely to improve the gallery preview. Preview spacing should not change the bounds of the Element when it is dragged into a project.+Do not add internal padding only to improve the gallery preview.## Make animations complete-If an Element has an entrance animation, it must also have an exit animation.--Animate values within the Element, such as translation, scale, and opacity. Placement in the video belongs to the surrounding `<Sequence>`.+Include an exit animation whenever there is an entrance animation. Animate properties within the Element, such as translation, scale, and opacity; leave placement to the surrounding `<Sequence>`.## Expose useful Studio controls-Only expose controls that make the Element meaningfully editable. Give each interactive object a descriptive name and avoid redundant nested controls for the same visual object.+Use 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.-The main editable object should usually have a generic name such as `Container`. Add named child controls only when the child represents a separately useful editing target.+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) when making an Element editable in Studio.+Follow the [interactivity best practices](/docs/studio/interactivity-best-practices).## Choose a representative preview-Choose a poster frame that shows the Element in a visible, representative state. The video preview should cover the complete configured duration, including entrance and exit animations.+Choose a poster frame that clearly shows the Element. The video preview should cover its full duration, including entrance and exit animations.-When the Element satisfies these guidelines, see [Submit an Element](/elements/submit-an-element).+When ready, [submit the Element](/elements/submit-an-element).diff --git a/packages/docs/elements/index.mdx b/packages/docs/elements/index.mdxindex 582bf40286..2509a2c0b7 100644--- a/packages/docs/elements/index.mdx+++ b/packages/docs/elements/index.mdx@@ -8,22 +8,8 @@ import {ElementLibrary} from '@site/src/components/Elements/ElementLibrary';# Remotion Elements-:::warning Work in progress--This section is being shaped. The format and Element list may change. You can track progress in [GitHub issue #7698](https://github.com/remotion-dev/remotion/issues/7698).--:::--Remotion Elements are drop-in, HTML-first Remotion components designed to be placed inside a [`<Sequence>`](/docs/sequence) and composed with your video.--They are practical video building blocks: captions, lower thirds, overlays, callouts, transitions, data cards, audio visuals, and title cards.--Remotion Elements can be sent directly from the web to your active Studio composition. The installation flow is powered by the [Remotion Studio Protocol](/docs/studio-protocol).--Browse the library to find an Element for your project.+Remotion Elements are drop-in, HTML-first video building blocks. Send one from this gallery to your active Studio composition, then customize and combine it inside a [`<Sequence>`](/docs/sequence).<ElementLibrary category={null} />-To learn what makes a useful, portable Element, read the [Element Guidelines](/elements/guidelines).--If you want to contribute one, see [Submit an Element](/elements/submit-an-element).+To contribute, follow the [Element Guidelines](/elements/guidelines) and [submission instructions](/elements/submit-an-element).